Repository navigation
Issue #989: the ten sidecar repair tests also pass on a case-insensitive volume (item 3, ten of eleven) - #1007
Merged
bflatastic merged 1 commit intoOct 13, 2026
Conversation
…-insensitive volume (item 3, ten of eleven) The tests were written for a case-sensitive disk. rename.rs sidecars() offers both .XMP and .xmp per naming and keeps those that exist; on case-insensitive APFS a.XMP "exists" for a file stored as a.xmp, so the code renames a.XMP while the fault injectors (Faults twice, PartialRename) compared exact paths with the lowercase one: the injected failure never fired and the rename the tests expect to be refused succeeded. Fault injectors now match by same_path_or_file (equal path, or the same file by identity); two assertions that compared an exact spelling use same_path_for_volume (equal, or equal ignoring ASCII case on a case-insensitive volume), and one that required the lowercase packet to be absent is skipped there, where both spellings are one file. Helpers live in tests_xmp.rs. Production code is not touched. Run with rustc 1.99.0 on macOS: case-insensitive APFS, the ten failed before and pass now; case-sensitive APFS (a disk image), the original tests pass and so do these. All 13 sidecar::tests_repair tests pass on both. cargo fmt is clean and clippy over lightcraft-engine with --all-targets is clean. Not touched: the .xmp -> .XMP spelling change on rename, and the Lightroom folder test (its own PR). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
snofla
added a commit
to snofla/lightcraft
that referenced
this pull request
Oct 11, 2026
…ytold#1007: sidecar repair tests on case-insensitive volumes (storytold#989 item 3)) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 11, 2026
Contributor
Author
|
Note: #1052 (opened after this PR) fixes the cause in production code, and with it the original, unmodified sidecar tests pass on macOS without these test changes (details in my comment there). So this PR is superseded if #1052 lands; I will close it then, or rebase it if #1052 changes. Leaving it open until that is decided. 🤖 Generated with Claude Code |
This was referenced Oct 11, 2026
This was referenced Oct 11, 2026
Member
|
Landed on main in #1431. Thank you, @snofla! Generated by Claude Code |
clydecbrown
pushed a commit
to clydecbrown/lightcraft
that referenced
this pull request
Nov 10, 2026
Manual: step-by-step masking, colour and profile coverage, Modern menu-only notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #989 (item 3, ten of its eleven tests; this PR does not close the issue). Test code only: production code is not touched.
Why the ten sidecar repair tests fail on macOS
They were written for a case-sensitive disk.
sidecars()incrates/engine/src/rename.rsoffers both.XMPand.xmpfor each naming convention and keeps the candidates that exist. On case-insensitive APFSa.XMP"exists" for a file stored asa.xmp, so the code movesa.XMP, while the tests' fault injectors (Faultsintests_repair_companions.rsandtests_repair_provenance.rs,PartialRenameintests_repair_saves.rs) compare paths exactly with the lowercase one. The injected failure never fires, and the rename the tests expect to be refused succeeds (assertion failed: ... .is_err()).This is a test-environment difference, but it also exposes a product quirk: on such a volume Rename Photos turns
a.xmpintoTrip.XMP. That is filed separately as #1006 and is not changed here.The change
In
crates/engine/src/tests_xmp.rs, three small helpers:same_path_or_file(a, b): equal paths, or the same file by identity (RealFs.same_file). The three fault injectors use it, so an injected failure fires whichever spelling the code under test uses. On a case-sensitive volume only identical paths match.same_path_for_volume(a, b): equal, or equal ignoring ASCII case on a case-insensitive volume. Two assertions inqueued_stem_retry_preserves_shared_packet_after_batch_rollbackthat compared an exact spelling use it.case_insensitive(dir): whetherdir's upper-cased path still resolves.autowrite_repairs_partial_rename_before_merging_foreign_xmp_across_library_switchasserted that the lowercase packet is absent; on a case-insensitive volume both spellings are one file, so that assertion is skipped there.Checked
macOS, rustc 1.99.0, Apple silicon:
TMPDIRpointed at it): the original, unmodified tests frommainpass, which confirms the cause above; the changed tests pass too, so they are not weaker there.sidecar::tests_repairtests pass on both volumes.cargo test -p lightcraft-engine --release -- sidecar::tests_repair tests_lightroom_foldergives 18 passed, 0 failed on this Mac.cargo fmt --all --checkis clean;cargo clippy -p lightcraft-engine --all-targets -- -D warningsis clean (with-A clippy::chunks_exact_to_as_chunks, the lint of item 4, because this branch is cut frommainbefore Issue #989: clippy 1.99, fill_box reads its buffer with as_chunks::<3>() (item 4) #997).Not run: Linux and FreeBSD. On a case-sensitive volume the helpers reduce to the original exact comparisons.
Not in this PR
.xmp->.XMPrename behaviour (Rename Photos: on a case-insensitive volume the sidecar a.xmp becomes Trip.XMP #1006).🤖 Generated with Claude Code