Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[tool.pytest.ini_options]
pythonpath = [
"."
]
43 changes: 42 additions & 1 deletion scripts/tests/test_distill.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Add the scripts directory to sys.path to allow importing distill
sys.path.append(str(pathlib.Path(__file__).parent.parent))

from distill import clean_signal
from distill import clean_signal, is_durable_signal

@pytest.mark.parametrize("input_line, expected", [
# Basic cases
Expand Down Expand Up @@ -49,3 +49,44 @@
])
def test_clean_signal(input_line, expected):
assert clean_signal(input_line) == expected


@pytest.mark.parametrize(
"line,expected",
[
# Empty
("", False),

# Length < 12
("short", False),
("12345678901", False),

# Starts with # or > [!
("# A heading that is long enough", False),
("> [!info] Some info", False),
("> [!warning] warning", False),

# NOISE_RE matches
("ok ", False),
("okay.", False),
("yes!", False),
("understood!!!", False),

# SHELL_NOISE_RE matches
("$ python3 script.py", False),
("Running test: xyz", False),
("Traceback (most recent call last):", False),
("Exception: Something went wrong", False),
("FAIL: test_something", False),
("error: must read the pane correctly", False),
("[tmux-bridge error]", False),

# Valid durable signals (Happy paths)
("123456789012", True),
("We decided to keep distill.py dry-run and let Claude own writes.", True),
("This is a valid durable signal that should be captured.", True),
("Next action: implement tests for distill.py.", True),
]
)
def test_is_durable_signal(line, expected):
assert is_durable_signal(line) is expected
Loading