mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Extract tests module to file in vfs crate
This commit is contained in:
parent
c8a2ff6ecc
commit
59bd6e2eea
4 changed files with 74 additions and 82 deletions
30
crates/vfs/src/vfs_path/tests.rs
Normal file
30
crates/vfs/src/vfs_path/tests.rs
Normal file
|
@ -0,0 +1,30 @@
|
|||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn virtual_path_extensions() {
|
||||
assert_eq!(VirtualPath("/".to_string()).name_and_extension(), None);
|
||||
assert_eq!(
|
||||
VirtualPath("/directory".to_string()).name_and_extension(),
|
||||
Some(("directory", None))
|
||||
);
|
||||
assert_eq!(
|
||||
VirtualPath("/directory/".to_string()).name_and_extension(),
|
||||
Some(("directory", None))
|
||||
);
|
||||
assert_eq!(
|
||||
VirtualPath("/directory/file".to_string()).name_and_extension(),
|
||||
Some(("file", None))
|
||||
);
|
||||
assert_eq!(
|
||||
VirtualPath("/directory/.file".to_string()).name_and_extension(),
|
||||
Some((".file", None))
|
||||
);
|
||||
assert_eq!(
|
||||
VirtualPath("/directory/.file.rs".to_string()).name_and_extension(),
|
||||
Some((".file", Some("rs")))
|
||||
);
|
||||
assert_eq!(
|
||||
VirtualPath("/directory/file.rs".to_string()).name_and_extension(),
|
||||
Some(("file", Some("rs")))
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue