Filter ANSI output before Slack forwarding
This commit is contained in:
18
tests/test_output_filter.py
Normal file
18
tests/test_output_filter.py
Normal 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"
|
||||
Reference in New Issue
Block a user