about summary refs log tree commit diff
path: root/library/std/src/path
diff options
context:
space:
mode:
authorMichael Hall <michael@mbh.sh>2021-06-15 14:47:23 +1000
committerMichael Hall <michael@mbh.sh>2021-06-15 14:47:23 +1000
commita889529e984f1d477153e60c16fa4066d8b6c9d7 (patch)
treeb46b56974ff4edda551c7778830ef8a4384543e7 /library/std/src/path
parent7465192c7de96ac46a9c5b0200a34a6d010068ac (diff)
downloadrust-a889529e984f1d477153e60c16fa4066d8b6c9d7.tar.gz
rust-a889529e984f1d477153e60c16fa4066d8b6c9d7.zip
add explicit hidden file name tests
Diffstat (limited to 'library/std/src/path')
-rw-r--r--library/std/src/path/tests.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs
index 7ffc787b0a2..d7ba4789391 100644
--- a/library/std/src/path/tests.rs
+++ b/library/std/src/path/tests.rs
@@ -445,6 +445,17 @@ pub fn test_decompositions_unix() {
     extension: Some("toml"),
     file_prefix: Some(".rustfmt")
     );
+
+    t!("a/.x.y.z",
+    iter: ["a", ".x.y.z"],
+    has_root: false,
+    is_absolute: false,
+    parent: Some("a"),
+    file_name: Some(".x.y.z"),
+    file_stem: Some(".x.y"),
+    extension: Some("z"),
+    file_prefix: Some(".x")
+    );
 }
 
 #[test]
@@ -1065,6 +1076,17 @@ pub fn test_decompositions_windows() {
     extension: None,
     file_prefix: Some(".foo")
     );
+
+    t!("a/.x.y.z",
+    iter: ["a", ".x.y.z"],
+    has_root: false,
+    is_absolute: false,
+    parent: Some("a"),
+    file_name: Some(".x.y.z"),
+    file_stem: Some(".x.y"),
+    extension: Some("z"),
+    file_prefix: Some(".x")
+    );
 }
 
 #[test]
@@ -1103,6 +1125,8 @@ pub fn test_stem_ext() {
 
     t!("..", file_stem: None, extension: None);
 
+    t!(".x.y.z", file_stem: Some(".x.y"), extension: Some("z"));
+
     t!("", file_stem: None, extension: None);
 }
 
@@ -1142,6 +1166,8 @@ pub fn test_prefix_ext() {
 
     t!("..", file_prefix: None, extension: None);
 
+    t!(".x.y.z", file_prefix: Some(".x"), extension: Some("z"));
+
     t!("", file_prefix: None, extension: None);
 }