mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-26 22:06:26 +00:00
Fixup: split prefix tests by property
This commit is contained in:
parent
ad39d6e282
commit
77fa8974c4
26
src/file.rs
26
src/file.rs
@ -534,14 +534,26 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_no_prefix() {
|
fn test_prefix_empty() {
|
||||||
let f = File::from_path(Path::new("Cargo.toml"), None).unwrap();
|
let f = File::from_path(Path::new("Cargo.toml"), None).unwrap();
|
||||||
assert_eq!("", f.path_prefix());
|
assert_eq!("", f.path_prefix());
|
||||||
let f2 = File::from_path(Path::new("src/main.rs"), None).unwrap();
|
}
|
||||||
assert_eq!("src/", f2.path_prefix());
|
|
||||||
let f3 = File::from_path(Path::new("src"), None).unwrap();
|
#[test]
|
||||||
assert_eq!("", f3.path_prefix());
|
fn test_prefix_file() {
|
||||||
let f4 = File::from_path(Path::new("/"), None).unwrap();
|
let f = File::from_path(Path::new("src/main.rs"), None).unwrap();
|
||||||
assert_eq!("", f4.path_prefix());
|
assert_eq!("src/", f.path_prefix());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_prefix_path() {
|
||||||
|
let f = File::from_path(Path::new("src"), None).unwrap();
|
||||||
|
assert_eq!("", f.path_prefix());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_prefix_root() {
|
||||||
|
let f = File::from_path(Path::new("/"), None).unwrap();
|
||||||
|
assert_eq!("", f.path_prefix());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user