use super::super::super::support::vv;
use super::hash_of;
use crate::metis::VersionVector;
#[test]
fn test_meet_is_common_knowledge() {
let a = vv(&[(1, 3), (2, 1)]);
let b = vv(&[(1, 2), (3, 4)]);
assert_eq!(a.meet(&b), vv(&[(1, 2)]));
assert_eq!(b.meet(&a), vv(&[(1, 2)]));
}
#[test]
fn test_meet_bottom_annihilates() {
let bottom = VersionVector::new();
let v = vv(&[(5, 1), (3, 9)]);
assert_eq!(v.meet(&bottom), bottom);
assert_eq!(bottom.meet(&v), bottom);
}
#[test]
fn test_meet_of_disjoint_pair_is_canonical() {
let a = vv(&[(1, 1)]);
let b = vv(&[(2, 1)]);
assert!(a.concurrent(&b));
let meet = a.meet(&b);
assert_eq!(meet, VersionVector::new());
assert_eq!(hash_of(&meet), hash_of(&VersionVector::new()));
}