Skip to content

Commit 27f6d2c

Browse files
committed
Relax tests for Windows dos device names
Windows 11 no longer turn paths ending with dos device names into device paths. E.g. `C:\path\to\COM1.txt` used to get turned into `\\.\COM1`. Whereas now the path is left as is.
1 parent 379e94f commit 27f6d2c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

library/std/src/path/tests.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,10 +1752,7 @@ fn test_windows_absolute() {
17521752
unchanged!(r"\\?\path.\to/file..");
17531753

17541754
assert_eq!(absolute(r"C:\path..\to.\file.").unwrap(), Path::new(r"C:\path..\to\file"));
1755-
assert_eq!(absolute(r"C:\path\to\COM1").unwrap(), Path::new(r"\\.\COM1"));
1756-
assert_eq!(absolute(r"C:\path\to\COM1.txt").unwrap(), Path::new(r"\\.\COM1"));
1757-
assert_eq!(absolute(r"C:\path\to\COM1 .txt").unwrap(), Path::new(r"\\.\COM1"));
1758-
assert_eq!(absolute(r"C:\path\to\cOnOuT$").unwrap(), Path::new(r"\\.\cOnOuT$"));
1755+
assert_eq!(absolute(r"COM1").unwrap().as_os_str(), Path::new(r"\\.\COM1").as_os_str());
17591756
}
17601757

17611758
#[bench]

0 commit comments

Comments
 (0)