aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-10 18:49:45 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-10 18:49:45 +0800
commitf9f0a06ca78aaeb8b520aab179da5709edf36bc9 (patch)
treed2770ca65aee94b425eb33fb8ac0361e0eeea6a7
parentd7f32c05222ec860014ac29d807903ae7fa56258 (diff)
feat: normalize test path for Windows verbatim prefixes
-rw-r--r--mingling_cli/src/proj_mgr/cmd_class_add.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/mingling_cli/src/proj_mgr/cmd_class_add.rs b/mingling_cli/src/proj_mgr/cmd_class_add.rs
index 456ec2f..9c729a9 100644
--- a/mingling_cli/src/proj_mgr/cmd_class_add.rs
+++ b/mingling_cli/src/proj_mgr/cmd_class_add.rs
@@ -283,7 +283,11 @@ mod tests {
fs::create_dir_all(tmp.join("project/.mling")).unwrap();
// Found at the project root.
- let root = tmp.join("project");
+ // Normalize the expected path the way `find_project_root` does
+ // (canonicalize + strip the Windows verbatim prefix) so the
+ // comparison is immune to Windows 8.3 short-name / long-name
+ // differences and the `\\?\` prefix.
+ let root = deverbatim(&fs::canonicalize(tmp.join("project")).unwrap());
assert_eq!(find_project_root(&root), Some(root.clone()));
// Found by walking up from a deep subdirectory.