Skip to content

Write to the renamed folder's new name in the case-rename test - #12

Draft
joshyunho wants to merge 1 commit into
mainfrom
foldersync/case-sensitive-tests
Draft

joshyunho wants to merge 1 commit into
mainfrom
foldersync/case-sensitive-tests

Conversation

@joshyunho

Copy link
Copy Markdown
Collaborator

Summary

Before

"syncs an edit made after the scan to a file in a folder renamed in case only" edited shots/a.txt after the pass had renamed the folder to Shots. On a case-insensitive disk that's the same file. On a case-sensitive disk, like Linux's, it created a second shots/ folder, so the test failed with expected 'A' to be 'edited after the scan'.

After

The test writes to Shots/a.txt, the folder's real name, so it passes on both kinds of disk. CONTRIBUTING.md and AGENTS.md say how to run the tests on a case-sensitive disk. Tests make their temp folders under TMPDIR, so on a Mac it's TMPDIR=/Volumes/<case-sensitive volume> npm test.

A project with both shots/ and Shots/ on a case-sensitive disk isn't tested yet. It needs a sync decision first.

Test plan

  • macOS (case-insensitive): npm test, 293 passed.
  • macOS on a case-sensitive APFS disk image, with TMPDIR: main fails this test the same way Linux does. With this change, 293 passed.
  • Ubuntu 24.04 (case-sensitive /tmp): 292 passed, 1 skipped (a macOS-only Unicode test).
  • Lint and format pass.

The test edited shots/a.txt after the pass had renamed the folder to Shots.
On a case-insensitive disk that's the same file, but on a case-sensitive one
it's a new folder, so the test failed on Linux. CONTRIBUTING.md and AGENTS.md
say how to run the tests on a case-sensitive disk with TMPDIR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant