Files
EvoScientist/tests/test_rich_escape.py
T
m4 c2743251e9 Initial commit of EvoScientist framework
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>
2026-07-13 08:07:45 +08:00

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