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:600–614  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

598
599#[test]
600fn test_walk_files_nested() {
601 let (dir, fs) = temp_fs();
602 std::fs::create_dir_all(dir.path().join("a/b")).unwrap();
603 std::fs::write(dir.path().join("root.txt"), "").unwrap();
604 std::fs::write(dir.path().join("a/middle.txt"), "").unwrap();
605 std::fs::write(dir.path().join("a/b/deep.txt"), "").unwrap();
606
607 let files = fs.walk_files("").unwrap();
608
609 assert_eq!(files.len(), 3);
610 assert!(files.contains(&"root.txt".to_string()));
611 assert!(
612 files.contains(&"a/middle.txt".to_string()) || files.contains(&"a\\middle.txt".to_string())
613 ); // Windows compat
614}
615
616#[test]
617fn test_walk_files_excludes_atomic_dir() {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected