Fix compact summary regex replacement

This commit is contained in:
wuyang6
2026-07-07 21:21:19 +08:00
parent da8b63443b
commit f5f98688dd
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -112,6 +112,12 @@ class TestFormatCompactSummary(unittest.TestCase):
self.assertNotIn('Line 1', formatted)
self.assertIn('Final summary', formatted)
def test_summary_content_keeps_regex_backslashes_literal(self) -> None:
raw = r'<summary>Regex examples: \s+ and \1 should stay literal.</summary>'
formatted = format_compact_summary(raw)
self.assertIn(r'\s+', formatted)
self.assertIn(r'\1', formatted)
class TestGetCompactUserSummaryMessage(unittest.TestCase):
"""Tests for the post-compact user message builder."""