MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_walk_files_nested

Function test_walk_files_nested

atomic-core/src/output/filesystem/tests.rs:622–636  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

620
621#[test]
622fn test_walk_files_nested() {
623 let (dir, fs) = temp_fs();
624 std::fs::create_dir_all(dir.path().join("a/b")).unwrap();
625 std::fs::write(dir.path().join("root.txt"), "").unwrap();
626 std::fs::write(dir.path().join("a/middle.txt"), "").unwrap();
627 std::fs::write(dir.path().join("a/b/deep.txt"), "").unwrap();
628
629 let files = fs.walk_files("").unwrap();
630
631 assert_eq!(files.len(), 3);
632 assert!(files.contains(&"root.txt".to_string()));
633 assert!(
634 files.contains(&"a/middle.txt".to_string()) || files.contains(&"a\\middle.txt".to_string())
635 ); // Windows compat
636}
637
638#[test]
639fn test_walk_files_excludes_atomic_dir() {

Callers

nothing calls this directly

Calls 5

temp_fsFunction · 0.85
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
walk_filesMethod · 0.45

Tested by

no test coverage detected