diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-02 12:34:19 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-02 12:34:19 +0000 |
commit | a8f04712d6a36c5ce870135767d92203a1b2c8ad (patch) | |
tree | 2561704ac02e601addd577e39fa5d724ab380c54 /crates/vfs/src/vfs_path/tests.rs | |
parent | 14086e311853d2c40f50102821ff6355c828d0e3 (diff) | |
parent | 59bd6e2eea151f097a65f2634dc5488b3c272d92 (diff) |
Merge #6679
6679: Extract tests module to file in vfs crate r=matklad a=sasurau4
Helps with #6522
- [x] passed `cargo test`
Co-authored-by: Daiki Ihara <[email protected]>
Diffstat (limited to 'crates/vfs/src/vfs_path/tests.rs')
-rw-r--r-- | crates/vfs/src/vfs_path/tests.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/vfs/src/vfs_path/tests.rs b/crates/vfs/src/vfs_path/tests.rs new file mode 100644 index 000000000..510e021e8 --- /dev/null +++ b/crates/vfs/src/vfs_path/tests.rs | |||
@@ -0,0 +1,30 @@ | |||
1 | use super::*; | ||
2 | |||
3 | #[test] | ||
4 | fn virtual_path_extensions() { | ||
5 | assert_eq!(VirtualPath("/".to_string()).name_and_extension(), None); | ||
6 | assert_eq!( | ||
7 | VirtualPath("/directory".to_string()).name_and_extension(), | ||
8 | Some(("directory", None)) | ||
9 | ); | ||
10 | assert_eq!( | ||
11 | VirtualPath("/directory/".to_string()).name_and_extension(), | ||
12 | Some(("directory", None)) | ||
13 | ); | ||
14 | assert_eq!( | ||
15 | VirtualPath("/directory/file".to_string()).name_and_extension(), | ||
16 | Some(("file", None)) | ||
17 | ); | ||
18 | assert_eq!( | ||
19 | VirtualPath("/directory/.file".to_string()).name_and_extension(), | ||
20 | Some((".file", None)) | ||
21 | ); | ||
22 | assert_eq!( | ||
23 | VirtualPath("/directory/.file.rs".to_string()).name_and_extension(), | ||
24 | Some((".file", Some("rs"))) | ||
25 | ); | ||
26 | assert_eq!( | ||
27 | VirtualPath("/directory/file.rs".to_string()).name_and_extension(), | ||
28 | Some(("file", Some("rs"))) | ||
29 | ); | ||
30 | } | ||