-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #74220 - lzutao:windows-path-com, r=LukasKalbertodt
Refactor Windows `parse_prefix` These changes make me feel more readable. See the commit messages for more details.
- Loading branch information
Showing
4 changed files
with
103 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use super::*; | ||
|
||
#[test] | ||
fn test_get_first_two_components() { | ||
assert_eq!( | ||
get_first_two_components(br"server\share", is_verbatim_sep), | ||
Some((&b"server"[..], &b"share"[..])), | ||
); | ||
|
||
assert_eq!( | ||
get_first_two_components(br"server\", is_verbatim_sep), | ||
Some((&b"server"[..], &b""[..])) | ||
); | ||
|
||
assert_eq!( | ||
get_first_two_components(br"\server\", is_verbatim_sep), | ||
Some((&b""[..], &b"server"[..])) | ||
); | ||
|
||
assert_eq!(get_first_two_components(br"there are no separators here", is_verbatim_sep), None,); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters