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

Function test_zip_funcion

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

Source from the content-addressed store, hash-verified

561 #[case("binary-x86-64", "x86_64")]
562 #[case("binary-arm64", "arm64")]
563 fn test_zip_funcion(#[case] name: &str, #[case] arch: &str) {
564 let data = BinaryData::new(name, false, false);
565 let bp = &format!("../../tests/binaries/{name}");
566 let dd = TempDir::with_prefix("cargo-lambda-").expect("failed to create temp dir");
567 let archive =
568 zip_binary(bp, dd.path(), &data, None).expect("failed to create binary archive");
569
570 assert_eq!(arch, archive.architecture);
571
572 let arch_path = dd.path().join("bootstrap.zip");
573 assert_eq!(arch_path, archive.path);
574
575 let file = File::open(arch_path).expect("failed to open zip file");
576 let mut zip = ZipArchive::new(file).expect("failed to open zip archive");
577
578 zip.by_name("bootstrap")
579 .expect("failed to find bootstrap in zip archive");
580 }
581
582 #[rstest]
583 #[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