Test nanosecond mtime precision on file and symlink copies (#22)

* Test nanosecond mtime precision on file and symlink copies

Existing preserves-times tests only set whole-second timestamps via
os.utime(path, (sec, sec)), so a backend that silently truncated to
second resolution would still pass them. The Python backend's
nanosecond-precision guarantee (documented in README's Limitations
section) was otherwise untested at sub-second granularity.

Combined with CI already running the full suite on both ubuntu-latest
and macos-latest, this closes the "Test supported behavior on Linux
and macOS" item in IMPROVEMENTS.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Rename nanosecond timestamp tests to cover atime too

Copilot review feedback on PR #22: both tests assert st_atime_ns and
st_mtime_ns, but the names/docstrings said "mtime" only.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Assert symlink entry is found before use in nanosecond test

Copilot review feedback on PR #22: if the scandir() loop didn't find
the symlink, entry stayed None and copy_direntry() would fail with a
less-informative error than an explicit assertion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Maxim Shulga <maxim.shulga@alludo.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-08-09 01:12:50 +00:00
1 parent 4a4797e959
commit 699c569cc2
2 files changed
+57 -1

No files matched your search

+1 -1
View File
@@ -143,7 +143,7 @@ Acceptance criteria:
- [x] Add an explicit one-filesystem policy.
- [x] Make Python and external implementations provide equivalent guarantees or
document every difference.
- [ ] Test supported behavior on Linux and macOS.
- [x] Test supported behavior on Linux and macOS.
### Make dry-run genuinely non-mutating