test(editor): resolve temp dirs the way the editor does

On the Windows runner the temp dir is an 8.3 short name (RUNNER~1),
which the editor's load expands through Host::canonicalize. The split
tests now resolve their fixtures through that same call instead of
guessing per platform.
This commit is contained in:
l0ng-ai
2026-09-28 20:16:01 +08:00
parent e3a28b8608
commit cbf0b22e53
+7 -9
View File
@@ -3757,16 +3757,14 @@ impl Tty7App {
mod tests {
use super::*;
/// A temp dir as the editor will see paths under it: resolved through
/// symlinks where the OS puts one in the way (`/var` is `/private/var` on
/// macOS). Not on Windows, where `canonicalize` answers in the `\\?\` form
/// no path the editor holds is ever in.
/// A temp dir as the editor will see paths under it: through the local
/// host's `canonicalize`, the call `load_file` makes. That resolves
/// macOS's `/var` → `/private/var` and Windows' 8.3 short names
/// (`RUNNER~1`), and never answers in Windows' `\\?\` form.
pub(crate) fn test_real_dir(dir: &Path) -> PathBuf {
if cfg!(windows) {
dir.to_path_buf()
} else {
dir.canonicalize().unwrap()
}
tty7_core::host::local::LocalHost::new()
.canonicalize(dir)
.unwrap()
}
/// Handing a file the editor cannot read to the desktop is how a click