add test for windows drive traversal

This commit is contained in:
Rob Ede 2022-01-25 16:01:55 +00:00
parent 5454699bab
commit 405663cf48
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
1 changed files with 13 additions and 0 deletions

View File

@ -159,4 +159,17 @@ mod tests {
PathBuf::from_iter(vec!["etc/passwd"])
);
}
#[test]
fn windows_drive_traversal() {
assert_eq!(
PathBufWrap::parse_path("D:test.txt", false).unwrap().0,
PathBuf::from_iter(vec!["D:test.txt"])
);
assert_eq!(
PathBufWrap::parse_path("C:../whatever", false).unwrap().0,
PathBuf::from_iter(vec!["C:../whatever"])
);
}
}