test(backup): add delta union test

Jef Roosens 2025-05-19 11:46:19 +02:00
parent a9fa0e1590
commit ed13fb7511
Signed by: Jef Roosens
GPG Key ID: 02D4C0997E74717B
1 changed files with 12 additions and 0 deletions

View File

@ -230,4 +230,16 @@ mod tests {
assert_eq!(expected, a.union(&b));
assert_eq!(expected, b.union(&a));
}
#[test]
fn test_union_full_revert() {
let a = Delta::default().with_added("dir_1", ["file1", "file2"]);
let b = Delta::default().with_removed("dir_1", ["file1", "file2"]);
let expected = Delta::default().with_removed("dir_1", ["file1", "file2"]);
assert_eq!(expected, a.union(&b));
let expected = Delta::default().with_added("dir_1", ["file1", "file2"]);
assert_eq!(expected, b.union(&a));
}
}