From a82049587c2abbf85dc40a68c52834b068f88406 Mon Sep 17 00:00:00 2001 From: David Cook Date: Sun, 26 Jan 2020 15:45:35 -0600 Subject: [PATCH] Use longer file names in test --- tests/run-pass/fs.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/run-pass/fs.rs b/tests/run-pass/fs.rs index 8db755c7a730..59eb4e014378 100644 --- a/tests/run-pass/fs.rs +++ b/tests/run-pass/fs.rs @@ -201,29 +201,31 @@ fn test_directory() { assert!(dir_path.metadata().unwrap().is_dir()); // Create some files inside the directory - let f1_path = dir_path.join("f1"); - drop(File::create(&f1_path).unwrap()); - let f2_path = dir_path.join("f2"); - drop(File::create(&f2_path).unwrap()); + let path_1 = dir_path.join("test_file_1"); + drop(File::create(&path_1).unwrap()); + let path_2 = dir_path.join("test_file_2"); + drop(File::create(&path_2).unwrap()); // Test that the files are present inside the directory let mut dir_iter = read_dir(&dir_path).unwrap(); let first_dir_entry = dir_iter.next().unwrap().unwrap(); let second_dir_entry = dir_iter.next().unwrap().unwrap(); assert!( - first_dir_entry.file_name() == "f1" || first_dir_entry.file_name() == "f2", - "File name was {:?} instead of f1 or f2", + first_dir_entry.file_name() == "test_file_1" || + first_dir_entry.file_name() == "test_file_2", + "File name was {:?} instead of test_file_1 or test_file_2", first_dir_entry.file_name(), ); assert!( - second_dir_entry.file_name() == "f1" || second_dir_entry.file_name() == "f2", - "File name was {:?} instead of f1 or f2", + second_dir_entry.file_name() == "test_file_1" || + second_dir_entry.file_name() == "test_file_2", + "File name was {:?} instead of test_file_1 or test_file_2", second_dir_entry.file_name(), ); assert!(dir_iter.next().is_none()); drop(dir_iter); // Clean up the files in the directory - remove_file(&f1_path).unwrap(); - remove_file(&f2_path).unwrap(); + remove_file(&path_1).unwrap(); + remove_file(&path_2).unwrap(); // Deleting the directory should succeed. remove_dir(&dir_path).unwrap();