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