mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 00:02:23 +00:00
Measuring first changed what was worth doing. Of the fixtures left after the previous commit, six prefixes turned out to create no directory at all, while two accounted for 6,676 of them: `completion` (14 fixtures, 4,219 directories) and `file_copy` (15, 2,457). Both build every fixture through one helper, so both are one edit. A `cargo test` run of the bin crate now adds 3 directories where it added 37 before this pair of commits, and both converted prefixes hold at exactly the count they started at. The three that remain are deliberate. `pin_test_config_dir` and the `set_config_dir` fixtures in `session`, `tree_sync`, `windows` and `main` all point *process-global* state at their directory: no scope owns it, tests in the same binary run in parallel against it, and a guard that freed it at the end of one test would pull it out from under another. `file_copy` compared paths it got back from the system against its fixture, so it canonicalized — macOS answers `/private/var` for a temp dir under `/var`. `TempRoot::canonicalized` resolves in place so the removal stays attached, rather than handing back a bare path again. The completion fixtures said `dir.as_path()`, which was inherent on `PathBuf` and is not on the guard; they take a `&Path` by deref now.