ソースを参照

Fixup: split prefix tests by property

Florian Gilcher 10 年 前
コミット
77fa8974c4
1 ファイル変更19 行追加7 行削除
  1. 19 7
      src/file.rs

+ 19 - 7
src/file.rs

@@ -534,14 +534,26 @@ mod test {
     }
 
     #[test]
-    fn test_no_prefix() {
+    fn test_prefix_empty() {
         let f = File::from_path(Path::new("Cargo.toml"), None).unwrap();
         assert_eq!("", f.path_prefix());
-        let f2 = File::from_path(Path::new("src/main.rs"), None).unwrap();
-        assert_eq!("src/", f2.path_prefix());
-        let f3 = File::from_path(Path::new("src"), None).unwrap();
-        assert_eq!("", f3.path_prefix());
-        let f4 = File::from_path(Path::new("/"), None).unwrap();
-        assert_eq!("", f4.path_prefix());
+    }
+
+    #[test]
+    fn test_prefix_file() {
+        let f = File::from_path(Path::new("src/main.rs"), None).unwrap();
+        assert_eq!("src/", f.path_prefix());
+    }
+
+    #[test]
+    fn test_prefix_path() {
+        let f = File::from_path(Path::new("src"), None).unwrap();
+        assert_eq!("", f.path_prefix());
+    }
+
+    #[test]
+    fn test_prefix_root() {
+        let f = File::from_path(Path::new("/"), None).unwrap();
+        assert_eq!("", f.path_prefix());
     }
 }