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

Function test_directory_archive_create_file

atomic-repository/src/archive.rs:1158–1170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1156
1157 #[test]
1158 fn test_directory_archive_create_file() {
1159 let temp_dir = TempDir::new().unwrap();
1160 let archive_dir = temp_dir.path().join("archive");
1161
1162 let mut archive = DirectoryArchive::new(&archive_dir).unwrap();
1163 let mut writer = archive.create_file("test.txt", 11, 0o644, 0).unwrap();
1164
1165 writer.write_all(b"Hello World").unwrap();
1166 archive.close_file(writer).unwrap();
1167
1168 let contents = std::fs::read_to_string(archive_dir.join("test.txt")).unwrap();
1169 assert_eq!(contents, "Hello World");
1170 }
1171
1172 #[test]
1173 fn test_directory_archive_create_nested_file() {

Callers

nothing calls this directly

Calls 4

create_fileMethod · 0.80
close_fileMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected