We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67f8797 commit febb9b5Copy full SHA for febb9b5
src/file.rs
@@ -78,4 +78,21 @@ mod tests {
78
let items = list_all_file_items(Path::new("doesnt_exist"));
79
assert_eq!(0, items.len());
80
}
81
+
82
+ #[test]
83
+ fn test_get_file_items() {
84
+ // Create a dummy directory structure for testing
85
+ fs::create_dir_all("./test_dir/subdir").unwrap();
86
+ fs::File::create("./test_dir/file1.txt").unwrap();
87
+ fs::File::create("./test_dir/subdir/file2.txt").unwrap();
88
89
+ let line = "test_dir/subdir/";
90
+ let root_folder = "./";
91
+ let items = get_file_items(line, root_folder);
92
93
+ assert!(items.contains(&("file2.txt".to_string(), 15)));
94
95
+ // Clean up the dummy directory structure
96
+ fs::remove_dir_all("./test_dir").unwrap();
97
+ }
98
0 commit comments