diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 02:11:06 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 02:11:06 +0000 |
| commit | 0d60d812c4dcf78a18dcc59325dc1ec609cf8eb8 (patch) | |
| tree | 326a4dc80cc81d87bbae8b4537c9e47f5a04c8bb /tests | |
| parent | 271ccc76ad22436b7e0d5291168a5d18c57bb77b (diff) | |
Distinguish initrd additions and removals
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/compare.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/compare.rs b/tests/compare.rs index 59b62cb..0853572 100644 --- a/tests/compare.rs +++ b/tests/compare.rs @@ -51,6 +51,33 @@ fn compares_added_removed_and_changed_semantic_records() { } #[test] +fn distinguishes_added_and_removed_initrd_records() { + let without_initrd = ArtifactManifest::new(vec![], vec![], None, vec![], vec![]) + .expect("valid manifest without initrd"); + let with_initrd = ArtifactManifest::new( + vec![], + vec![], + Some(InitrdRecord::new("boot/initrd-rt.img", "digest")), + vec![], + vec![], + ) + .expect("valid manifest with initrd"); + + assert_eq!( + compare(&without_initrd, &with_initrd).differences(), + &[SemanticDifference::Initrd { + change: Change::Added + }] + ); + assert_eq!( + compare(&with_initrd, &without_initrd).differences(), + &[SemanticDifference::Initrd { + change: Change::Removed + }] + ); +} + +#[test] fn reads_and_writes_a_toml_manifest_beside_an_artifact() { let fixture = tempdir().expect("temporary directory"); let artifact = fixture.path().join("controller.tar"); |