pub fn verdict(parts: &[(ProofState, bool)]) -> (ProofState, bool)Expand description
A subject’s verdict over its parts: the one aggregation
(crate::evidence::freshness::aggregate) over the declared order, and whether any part
can carry proof. A failing part makes the subject failing; otherwise the weakest part
that can carry proof decides; otherwise the weakest of all; and no part reads no_test.
use majordomus_cli::evidence::subject::verdict;
use majordomus_cli::evidence::ProofState::{Failing, NoTest, NotRun, Proven};
assert_eq!(verdict(&[(Failing, true), (NotRun, true)]), (Failing, true));
assert_eq!(verdict(&[(Proven, true), (NotRun, false)]), (Proven, true));
assert_eq!(verdict(&[(NotRun, false)]), (NotRun, false));
assert_eq!(verdict(&[]), (NoTest, false));