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

Function layer_from_entries_encodes_whiteouts

atomic-repository/src/oci.rs:369–381  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367
368 #[test]
369 fn layer_from_entries_encodes_whiteouts() {
370 let files = vec![("a/b.txt".to_string(), b"content".to_vec())];
371 let whiteouts = vec!["a/gone.txt".to_string()];
372
373 let layer = layer_from_entries(&files, &whiteouts).unwrap();
374 let entries = read_layer_entries(&layer.tar_gz);
375 let paths: Vec<&str> = entries.iter().map(|(p, _)| p.as_str()).collect();
376
377 assert!(paths.contains(&"a/b.txt"));
378 assert!(paths.contains(&"a/.wh.gone.txt"));
379 let wh = entries.iter().find(|(p, _)| p == "a/.wh.gone.txt").unwrap();
380 assert!(wh.1.is_empty());
381 }
382
383 #[test]
384 fn whiteout_path_handles_root_and_nested() {

Callers

nothing calls this directly

Calls 5

layer_from_entriesFunction · 0.85
read_layer_entriesFunction · 0.85
unwrapMethod · 0.45
iterMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected