diff options
| author | Sean Young <sean@mess.org> | 2021-09-26 14:21:22 +0100 |
|---|---|---|
| committer | Sean Young <sean@mess.org> | 2021-10-01 19:54:57 +0100 |
| commit | fa4072f7d32221adf5edc8d57c9cb8fef3ddc96e (patch) | |
| tree | 4a61de865dd7876b51f7233ee1f47758e0a8da5a /library/std/src/path | |
| parent | ac8dd1b2f24dc62c962172b27433106b4e84dc62 (diff) | |
| download | rust-fa4072f7d32221adf5edc8d57c9cb8fef3ddc96e.tar.gz rust-fa4072f7d32221adf5edc8d57c9cb8fef3ddc96e.zip | |
path.push() should work as expected on windows verbatim paths
Diffstat (limited to 'library/std/src/path')
| -rw-r--r-- | library/std/src/path/tests.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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"); } } |
