fix: update test to count unique AI comments instead of raw lines

This commit is contained in:
Paul Gauthier (aider) 2024-12-01 10:30:57 -08:00
parent cfc4b79a05
commit d8a75bef48

View file

@ -23,7 +23,9 @@ def test_ai_comment_pattern():
# Test Python fixture
py_path = fixtures_dir / "watch.py"
py_lines, py_comments, py_has_bang = watcher.get_ai_comments(str(py_path))
assert len(py_lines) == 11, f"Expected 11 AI comments in Python fixture, found {len(py_lines)}"
# Count unique AI comments (excluding duplicates and variations with extra spaces)
unique_py_comments = set(comment.strip().lower() for comment in py_comments)
assert len(unique_py_comments) == 11, f"Expected 11 unique AI comments in Python fixture, found {len(unique_py_comments)}"
assert py_has_bang, "Expected at least one bang (!) comment in Python fixture"
# Test JavaScript fixture