minerva 0.2.0

Causal ordering for distributed systems
use proptest::prelude::*;

use super::super::arb_ops;
use super::super::run;

proptest! {
    /// Base change commutes with causal merge on the sequence store.
    #[test]
    fn prop_restrict_commutes_with_merge(
        ops in arb_ops(), roster in prop::collection::vec(1u32..5, 0..5),
    ) {
        let (live, _) = run(&ops);
        let (a, b) = (&live[0], &live[2]);
        let merged_then_restricted = a.merge(b).restrict(roster.iter().copied());
        let restricted_then_merged = a
            .restrict(roster.iter().copied())
            .merge(&b.restrict(roster.iter().copied()));
        prop_assert_eq!(
            merged_then_restricted.store(),
            restricted_then_merged.store()
        );
    }
}