From 61316e80b6b385a1ca8ea1322688a121acefd800 Mon Sep 17 00:00:00 2001 From: ayushcodes10 Date: Mon, 14 Sep 2026 22:42:41 +0530 Subject: [PATCH] Add negative control test for an ordinary ASCII path Confirms the reconstructed prefix set for an ASCII path is byte for byte identical to what the old ASCII only regex produced, so the fix changes behavior only for paths the old code was already getting wrong. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh (cherry picked from commit 97bd1f37f07125f8b15f993ce7e62a28208058c1) --- tests/test_dedup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_dedup.py b/tests/test_dedup.py index b8b8041f0..07e4614b7 100644 --- a/tests/test_dedup.py +++ b/tests/test_dedup.py @@ -572,6 +572,15 @@ def test_korean_defining_file_wins_over_referencing_file(nodes): ) +def test_id_prefixes_ascii_path_unchanged(): + """Negative control: an ordinary ASCII path's reconstructed prefixes must + be identical to what the old ASCII only regex produced.""" + from graphify.dedup import _id_prefixes + assert _id_prefixes("docs/v1/api/README.md") == { + "readme", "api_readme", "v1_api_readme", "docs_v1_api_readme", + } + + def test_same_file_relabel_is_noted(capsys): """Two labels for one ID from one file: the loser's label is discarded, which is the one drop that used to be silent. It is a note, not a collision warning."""