path.push() should work as expected on windows verbatim paths

This commit is contained in:
Sean Young
2021-09-26 14:21:22 +01:00
parent ac8dd1b2f2
commit fa4072f7d3
2 changed files with 55 additions and 7 deletions

View File

@@ -1262,6 +1262,15 @@ pub fn test_push() {
tp!("\\\\.\\foo", "..\\bar", "\\\\.\\foo\\..\\bar");
tp!("\\\\?\\C:", "foo", "\\\\?\\C:\\foo"); // this is a weird one
tp!(r"\\?\C:\bar", "../foo", r"\\?\C:\foo");
tp!(r"\\?\C:\bar", "../../foo", r"\\?\C:\foo");
tp!(r"\\?\C:\", "../foo", r"\\?\C:\foo");
tp!(r"\\?\C:", r"D:\foo/./", r"D:\foo/./");
tp!(r"\\?\C:", r"\\?\D:\foo\.\", r"\\?\D:\foo\.\");
tp!(r"\\?\A:\x\y", "/foo", r"\\?\A:\foo");
tp!(r"\\?\A:", r"..\foo\.", r"\\?\A:\foo");
tp!(r"\\?\A:\x\y", r".\foo\.", r"\\?\A:\x\y\foo");
}
}