blob: fbac1dc1ca17a017091e27a6bd082e11181a0729 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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,);
}
|