Skip to content
Open
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
13 changes: 13 additions & 0 deletions tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from graphify.paths import (
_is_test_path,
disambiguate_ambiguous_candidates,
nfc,
)


Expand Down Expand Up @@ -144,3 +145,15 @@ def test_is_absolute_any_platform_is_host_independent():
from graphify.paths import is_absolute_any_platform
assert is_absolute_any_platform("/home/ci/x.md")
assert is_absolute_any_platform("C:/Users/u/x.md")


# --- NFC normalization for cross-platform path identity ---------------------
# macOS reports filenames in NFD; manifests and graph source_file entries are
# typically NFC. Path membership checks that skip normalization treat the same
# file as two different paths (#2210, #2221/#2224).

def test_nfc_normalizes_decomposed_unicode() -> None:
decomposed = "e\u0301" # "e" + combining acute accent (NFD form)
composed = "\u00e9" # "é" precomposed (NFC form)
assert nfc(decomposed) == composed
assert nfc(composed) == composed # already-NFC input is a no-op