diff options
Diffstat (limited to 'library/std/src/sys/windows/path')
| -rw-r--r-- | library/std/src/sys/windows/path/tests.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/library/std/src/sys/windows/path/tests.rs b/library/std/src/sys/windows/path/tests.rs index 8656b04e4f4..2f7ec433bf2 100644 --- a/library/std/src/sys/windows/path/tests.rs +++ b/library/std/src/sys/windows/path/tests.rs @@ -114,3 +114,15 @@ fn test_parse_prefix_verbatim_device() { assert_eq!(prefix, parse_prefix(r"/\?\C:\windows\system32\notepad.exe")); assert_eq!(prefix, parse_prefix(r"\\?/C:\windows\system32\notepad.exe")); } + +// See #93586 for more infomation. +#[test] +fn test_windows_prefix_components() { + use crate::path::Path; + + let path = Path::new("C:"); + let mut components = path.components(); + let drive = components.next().expect("drive is expected here"); + assert_eq!(drive.as_os_str(), OsStr::new("C:")); + assert_eq!(components.as_path(), Path::new("")); +} |
