use super::conclude::agreement;
use super::types::{
AMBIENT_PATHWAY_DISAGREEMENT, DETERMINISM_DISAGREEMENT, Equivalence, PERMUTATION_DISAGREEMENT,
Road,
};
use crate::report::TrialConclusion;
#[must_use]
#[track_caller]
pub fn permutation_insensitivity<Domain, Image>(
subject: Road<Domain, Image>,
permute: Road<Domain, Domain>,
same: Equivalence<Image>,
value: &Domain,
) -> TrialConclusion {
let straight = subject(value);
let rearranged = subject(&permute(value));
agreement(same, &straight, &rearranged, PERMUTATION_DISAGREEMENT)
}
#[must_use]
#[track_caller]
pub fn determinism_run_twice<Domain, Image>(
subject: Road<Domain, Image>,
same: Equivalence<Image>,
value: &Domain,
) -> TrialConclusion {
let first = subject(value);
let second = subject(value);
agreement(same, &first, &second, DETERMINISM_DISAGREEMENT)
}
#[must_use]
#[track_caller]
pub fn ambient_pathway_invariance<Domain, Image>(
one_pathway: Road<Domain, Image>,
another_pathway: Road<Domain, Image>,
same: Equivalence<Image>,
value: &Domain,
) -> TrialConclusion {
let one = one_pathway(value);
let another = another_pathway(value);
agreement(same, &one, &another, AMBIENT_PATHWAY_DISAGREEMENT)
}