(#[case] name: &str, #[case] arch: &str)
| 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")] |
nothing calls this directly
no test coverage detected