From cbf0b22e53f941f1d4da3a42bc5deab90c191831 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:16:01 +0800 Subject: [PATCH] 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. --- src/ui/code_editor.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/ui/code_editor.rs b/src/ui/code_editor.rs index 6ba95063..e6eed147 100644 --- a/src/ui/code_editor.rs +++ b/src/ui/code_editor.rs @@ -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