diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-10 18:49:45 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-10 18:49:45 +0800 |
| commit | f9f0a06ca78aaeb8b520aab179da5709edf36bc9 (patch) | |
| tree | d2770ca65aee94b425eb33fb8ac0361e0eeea6a7 /mingling_cli/src | |
| parent | d7f32c05222ec860014ac29d807903ae7fa56258 (diff) | |
feat: normalize test path for Windows verbatim prefixes
Diffstat (limited to 'mingling_cli/src')
| -rw-r--r-- | mingling_cli/src/proj_mgr/cmd_class_add.rs | 6 |
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. |
