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

Function test_archive_options_builder

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

Source from the content-addressed store, hash-verified

911
912 #[test]
913 fn test_archive_options_builder() {
914 let state = Merkle::of(b"test");
915 let options = ArchiveOptions::new()
916 .format(ArchiveFormat::Tar)
917 .state(state)
918 .with_prefix("project-1.0/")
919 .include(&["src/*", "Cargo.toml"])
920 .exclude(&["*.log", "target/"])
921 .overwrite(true)
922 .compression_level(9);
923
924 assert_eq!(options.format, ArchiveFormat::Tar);
925 assert_eq!(options.state, Some(state));
926 assert_eq!(options.prefix, Some("project-1.0/".to_string()));
927 assert_eq!(options.include.len(), 2);
928 assert_eq!(options.exclude.len(), 2);
929 assert!(options.overwrite);
930 assert_eq!(options.compression_level, 9);
931 }
932
933 #[test]
934 fn test_archive_options_shortcuts() {

Callers

nothing calls this directly

Calls 7

overwriteMethod · 0.80
includeMethod · 0.80
compression_levelMethod · 0.45
excludeMethod · 0.45
with_prefixMethod · 0.45
stateMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected