From f9f0a06ca78aaeb8b520aab179da5709edf36bc9 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 10 Aug 2026 18:49:45 +0800 Subject: feat: normalize test path for Windows verbatim prefixes --- mingling_cli/src/proj_mgr/cmd_class_add.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. -- cgit