Tunal/Plans/12 Testing/S032-tests-core.md
2026-11-19 01:19:30 -06:00

1.6 KiB

S032 — Automated tests: core, ops, trash, dirmeta, elevation protocol

Category 12 Testing · Model: Sonnet · Effort: high · Depends on: S031, S029, S026, S024, S023, S021, S018, S016, S015 · Size: L · Human: no Files touched: crates/tunal-core/tests/, crates/tunal-core/src//tests, crates/tunal-dirmeta/tests/, crates/tunal-elevate/tests/

Goal

Test the pure logic and filesystem code of the solid app (D-013): location layer, ops engine, trash, .directory, elevation protocol.

Read

CLAUDE.md §3, §4; docs/PROGRESS.md (known bugs); the public APIs of these crates.

Steps

  • tunal-core: URIs, listing edge cases (non-UTF-8, symlinks, permission denied, 10 000 entries), watch diffs — temp dirs only.
  • Ops: copy/move/delete with conflicts (each resolution, apply to all), cancel mid-job, partial failures, cross-device move, copy into self refused, auto-rename.
  • Trash: trash/restore/empty with XDG_DATA_HOME in a temp dir, .trashinfo encoding, name collisions.
  • dirmeta: byte-exact round trips with comments/unknown keys/localized names.
  • Elevation protocol: encode/decode, helper driven without pkexec in a temp dir.
  • Fix bugs the tests find (regression test each) or log them in PROGRESS.
  • PROGRESS entry, INDEX line, commit S032: …

End criteria

  • cargo test --workspace green.
  • cargo build --workspace, cargo clippy --workspace --all-targets -- -D warnings and cargo fmt --check pass.

Pitfalls

  • Tests never touch the real home.
  • Fix only bugs the tests find; no refactors.

Handoff (→ PROGRESS.md)

Bugs found and fixed; anything left.