Filter ANSI output before Slack forwarding

This commit is contained in:
2026-02-17 03:46:36 +09:00
parent 582c19bb50
commit df377cf2df
3 changed files with 61 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
"""output_filter 모듈 테스트."""
from lazy_enter.output_filter import clean_terminal_output
def test_clean_terminal_output_removes_ansi_sequences():
raw = "\x1b[?2004h\x1b[38;2;153;153;153mClaude Code\x1b[39m"
assert clean_terminal_output(raw) == "Claude Code"
def test_clean_terminal_output_removes_broken_csi_tokens():
raw = "[?2004h[38;2;153;153;153mhello[39m"
assert clean_terminal_output(raw) == "hello"
def test_clean_terminal_output_preserves_plain_text():
raw = "line1\nline2"
assert clean_terminal_output(raw) == "line1\nline2"