Files
tty7/crates
l0ng-ai 3118fbccff test(history): hold both checks on the path a pane names for its history
The path is written by the shell, in a pane, out of an rc file — so it is
whatever someone put there — and the daemon then appends the pane's history
bytes to it. Two things have to hold before that write and neither had a
fixture.

A directory is not a file to append to. A relative path resolves against the
*daemon's* working directory rather than the pane's, so it names a file
nobody meant, and the daemon's cwd is not somewhere a user is thinking about
when they set `HISTFILE`.

The relative case needed care to pin. An obviously-bad relative path is
already refused by the parent-exists check further down, so it never asks
whether the path was absolute — the fixture has to be a relative name that
*resolves*. `cargo test` runs with the package root as the working
directory, so `Cargo.toml` is one, and that is exactly the hazard: a name
that looks harmless landing on a real file nobody pointed at. The test
asserts the file is there first, so a future change to the test working
directory says so rather than passing vacuously.
2026-08-24 02:17:57 +08:00
..