aboutsummaryrefslogtreecommitdiff
path: root/crates/vfs/src/vfs_path
diff options
context:
space:
mode:
authorDaiki Ihara <[email protected]>2020-11-30 15:10:12 +0000
committerDaiki Ihara <[email protected]>2020-11-30 15:10:12 +0000
commit59bd6e2eea151f097a65f2634dc5488b3c272d92 (patch)
tree647c3f191e7425791bf828387d5d3ce6f98b0cac /crates/vfs/src/vfs_path
parentc8a2ff6ecc8e45c7e1420e01d52c8b7a315140e6 (diff)
Extract tests module to file in vfs crate
Diffstat (limited to 'crates/vfs/src/vfs_path')
-rw-r--r--crates/vfs/src/vfs_path/tests.rs30
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 @@
1use super::*;
2
3#[test]
4fn 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}