diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 04:01:16 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 04:01:16 +0000 |
| commit | 196f315321643a0ce2327f750c779a7d40e4b427 (patch) | |
| tree | 700f3f67afea6f0a5086ce36782747ee63c26983 /tests/compare.rs | |
| parent | 815ec6e06e05f03022c2076f6e8573f1d2c454c9 (diff) | |
Avoid manifest collisions beside artifacts
Diffstat (limited to 'tests/compare.rs')
| -rw-r--r-- | tests/compare.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/compare.rs b/tests/compare.rs index 2e06a39..43c91e0 100644 --- a/tests/compare.rs +++ b/tests/compare.rs @@ -136,11 +136,29 @@ fn reads_and_writes_a_toml_manifest_beside_an_artifact() { let manifest = baseline(); let manifest_path = manifest.write_beside(&artifact).expect("write manifest"); - assert_eq!(manifest_path, fixture.path().join("artifact.manifest.toml")); + assert_eq!(manifest_path, fixture.path().join("controller.tar.manifest.toml")); assert_eq!(ArtifactManifest::load(&manifest_path).expect("load manifest"), manifest); } #[test] +fn writes_distinct_manifests_for_artifacts_in_the_same_directory() { + let fixture = tempdir().expect("temporary directory"); + let legacy = fixture.path().join("legacy.tar"); + let native = fixture.path().join("native.tar"); + let legacy_manifest = baseline(); + let native_manifest = ArtifactManifest::new(vec![], vec![], None, vec![], vec![]) + .expect("valid native manifest"); + + let legacy_path = legacy_manifest.write_beside(&legacy).expect("write legacy manifest"); + let native_path = native_manifest.write_beside(&native).expect("write native manifest"); + + assert_eq!(legacy_path, fixture.path().join("legacy.tar.manifest.toml")); + assert_eq!(native_path, fixture.path().join("native.tar.manifest.toml")); + assert_eq!(ArtifactManifest::load(&legacy_path).expect("load legacy manifest"), legacy_manifest); + assert_eq!(ArtifactManifest::load(&native_path).expect("load native manifest"), native_manifest); +} + +#[test] fn rejects_duplicate_semantic_keys() { let error = ArtifactManifest::new( vec![PackageRecord::new("controller", "1"), PackageRecord::new("controller", "2")], |