diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2020-11-03 19:26:31 +0100 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2020-11-07 16:15:48 +0100 |
| commit | 94d73d4403ef98b3b38b8e3035c2eac87fb900f9 (patch) | |
| tree | 25f3a6e8a3d5156ea60b062ee287fa4c43caf99d /library/std/src/path | |
| parent | a601302ff0217b91589b5a7310a8a23adb843fdc (diff) | |
| download | rust-94d73d4403ef98b3b38b8e3035c2eac87fb900f9.tar.gz rust-94d73d4403ef98b3b38b8e3035c2eac87fb900f9.zip | |
Refactor `parse_prefix` on Windows
Refactor `get_first_two_components` to `get_next_component`. Fixes the following behaviour of `parse_prefix`: - series of separator bytes in a prefix are correctly parsed as a single separator - device namespace prefixes correctly recognize both `\\` and `/` as separators
Diffstat (limited to 'library/std/src/path')
| -rw-r--r-- | library/std/src/path/tests.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs index ff94fda5a22..896d6c2a64c 100644 --- a/library/std/src/path/tests.rs +++ b/library/std/src/path/tests.rs @@ -873,12 +873,12 @@ pub fn test_decompositions_windows() { ); t!("\\\\.\\foo/bar", - iter: ["\\\\.\\foo/bar", "\\"], + iter: ["\\\\.\\foo", "\\", "bar"], has_root: true, is_absolute: true, - parent: None, - file_name: None, - file_stem: None, + parent: Some("\\\\.\\foo/"), + file_name: Some("bar"), + file_stem: Some("bar"), extension: None ); |
