aboutsummaryrefslogtreecommitdiff
path: root/crates/vfs/src/vfs_path.rs
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.rs
parentc8a2ff6ecc8e45c7e1420e01d52c8b7a315140e6 (diff)
Extract tests module to file in vfs crate
Diffstat (limited to 'crates/vfs/src/vfs_path.rs')
-rw-r--r--crates/vfs/src/vfs_path.rs33
1 files changed, 1 insertions, 32 deletions
diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs
index 815697597..bd14911c9 100644
--- a/crates/vfs/src/vfs_path.rs
+++ b/crates/vfs/src/vfs_path.rs
@@ -311,35 +311,4 @@ impl VirtualPath {
311} 311}
312 312
313#[cfg(test)] 313#[cfg(test)]
314mod tests { 314mod tests;
315 use super::*;
316
317 #[test]
318 fn virtual_path_extensions() {
319 assert_eq!(VirtualPath("/".to_string()).name_and_extension(), None);
320 assert_eq!(
321 VirtualPath("/directory".to_string()).name_and_extension(),
322 Some(("directory", None))
323 );
324 assert_eq!(
325 VirtualPath("/directory/".to_string()).name_and_extension(),
326 Some(("directory", None))
327 );
328 assert_eq!(
329 VirtualPath("/directory/file".to_string()).name_and_extension(),
330 Some(("file", None))
331 );
332 assert_eq!(
333 VirtualPath("/directory/.file".to_string()).name_and_extension(),
334 Some((".file", None))
335 );
336 assert_eq!(
337 VirtualPath("/directory/.file.rs".to_string()).name_and_extension(),
338 Some((".file", Some("rs")))
339 );
340 assert_eq!(
341 VirtualPath("/directory/file.rs".to_string()).name_and_extension(),
342 Some(("file", Some("rs")))
343 );
344 }
345}