From fa4072f7d32221adf5edc8d57c9cb8fef3ddc96e Mon Sep 17 00:00:00 2001 From: Sean Young Date: Sun, 26 Sep 2021 14:21:22 +0100 Subject: path.push() should work as expected on windows verbatim paths --- library/std/src/path/tests.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'library/std/src/path') diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs index ce23cf6cd21..3973a6829d3 100644 --- a/library/std/src/path/tests.rs +++ b/library/std/src/path/tests.rs @@ -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"); } } -- cgit 1.4.1-3-g733a5