test(cache): update order-independence salt test for case-preserving keys
#4937 made the file_hash salt case-preserving (dropped the .lower() on the absolute-path fallback), but the existing order-independence test still asserted the lowercased salt. Update its exp_abs to match the written-case salt so it pins the new behavior instead of the retired one (#4925, #4937). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
cd1400f25f
commit
2ab621790f
1 file changed
+4
-1
@@ -84,8 +84,11 @@ def test_file_hash_is_order_independent_across_roots(tmp_path, monkeypatch):
|
||||
|
||||
content = f.read_bytes()
|
||||
exp_rel = hashlib.sha256(content + b"\x00" + b"doc.txt").hexdigest()
|
||||
# The abs-path salt is case-preserving: it enters the digest as written, not
|
||||
# lowercased, so README.md and readme.md no longer collide on a case-sensitive
|
||||
# filesystem (#4925, #4937).
|
||||
exp_abs = hashlib.sha256(
|
||||
content + b"\x00" + str(cache._normalize_path(f).resolve()).replace("\\", "/").lower().encode()
|
||||
content + b"\x00" + str(cache._normalize_path(f).resolve()).replace("\\", "/").encode()
|
||||
).hexdigest()
|
||||
|
||||
# rel-first order
|
||||
|
||||
Reference in new issue
Block a user