c2743251e9
Self-evolving AI scientist framework built on LangGraph/LangChain with CLI/TUI core, FastAPI gateway, and Next.js frontend. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
21 lines
768 B
Python
21 lines
768 B
Python
"""Tests for Rich markup escape safety in formatter."""
|
|
|
|
from EvoScientist.stream.formatter import ToolResultFormatter
|
|
|
|
|
|
class TestRichMarkupEscape:
|
|
def test_panel_title_with_brackets(self):
|
|
"""Tool name with brackets shouldn't crash formatter."""
|
|
formatter = ToolResultFormatter()
|
|
result = formatter.format("arr[0]", "[OK]\nDone", max_length=800)
|
|
# Should not raise — content is safely rendered
|
|
assert result.elements
|
|
|
|
def test_error_format_with_brackets(self):
|
|
"""Error content with markup-like text shouldn't crash."""
|
|
formatter = ToolResultFormatter()
|
|
result = formatter.format(
|
|
"test", "Error: expected [int] got [str]", max_length=800
|
|
)
|
|
assert result.elements
|