MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / test_zip_extension

Function test_zip_extension

crates/cargo-lambda-build/src/archive.rs:585–603  ·  view source on GitHub ↗
(#[case] name: &str, #[case] arch: &str)

Source from the content-addressed store, hash-verified

583 #[case("binary-x86-64", "x86_64")]
584 #[case("binary-arm64", "arm64")]
585 fn test_zip_extension(#[case] name: &str, #[case] arch: &str) {
586 let data = BinaryData::new(name, true, false);
587
588 let bp = &format!("../../tests/binaries/{name}");
589 let dd = TempDir::with_prefix("cargo-lambda-").expect("failed to create temp dir");
590 let archive =
591 zip_binary(bp, dd.path(), &data, None).expect("failed to create binary archive");
592
593 assert_eq!(arch, archive.architecture);
594
595 let arch_path = dd.path().join(format!("{name}.zip"));
596 assert_eq!(arch_path, archive.path);
597
598 let file = File::open(arch_path).expect("failed to open zip file");
599 let mut zip = ZipArchive::new(file).expect("failed to open zip archive");
600
601 zip.by_name(&format!("extensions/{name}"))
602 .expect("failed to find bootstrap in zip archive");
603 }
604
605 #[rstest]
606 #[case("binary-x86-64", "x86_64")]

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
zip_binaryFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected