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.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.rs')
-rw-r--r-- | crates/vfs/src/vfs_path.rs | 33 |
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)] |
314 | mod tests { | 314 | mod 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 | } | ||