summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/compare.rs20
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")],