From 9b4c3548dc6209d5a75f1e53f3fe6679efc396fe Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Tue, 16 Jul 2019 11:05:40 +0200 Subject: [PATCH] Add regression test for short name generation --- tests/write.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/write.rs b/tests/write.rs index b60473b..71610ec 100644 --- a/tests/write.rs +++ b/tests/write.rs @@ -233,6 +233,13 @@ fn test_create_dir(fs: FileSystem) { names = subdir.iter().map(|r| r.unwrap().file_name()).collect::>(); assert_eq!(names, [".", "..", "long"]); } + // check short names validity after create_dir + { + let subdir = root_dir.create_dir("test").unwrap(); + names = subdir.iter().map(|r| r.unwrap().short_file_name()).collect::>(); + assert_eq!(names, [".", ".."]); + } + // check using create_dir with existing file fails assert!(root_dir.create_dir("very/long/path/test.txt").is_err()); }