()
| 654 | |
| 655 | #[test] |
| 656 | fn test_consistent_hash() { |
| 657 | let data = BinaryData::new("binary-x86-64", false, false); |
| 658 | |
| 659 | let bp = "../../tests/binaries/binary-x86-64"; |
| 660 | let dd = TempDir::with_prefix("cargo-lambda-").expect("failed to create temp dir"); |
| 661 | |
| 662 | let archive1 = |
| 663 | zip_binary(bp, dd.path(), &data, None).expect("failed to create binary archive"); |
| 664 | |
| 665 | // Sleep to ensure that the mtime is different enough for the hash to change |
| 666 | sleep(Duration::from_secs(2)); |
| 667 | |
| 668 | let archive2 = |
| 669 | zip_binary(bp, dd.path(), &data, None).expect("failed to create binary archive"); |
| 670 | |
| 671 | assert_eq!(archive1.sha256().unwrap(), archive2.sha256().unwrap()); |
| 672 | } |
| 673 | |
| 674 | #[test] |
| 675 | fn test_create_binary_archive_with_base_path() { |
nothing calls this directly
no test coverage detected