use crate::proof::comparator::ComparatorKind;
use crate::spec::types::{ChainSpec, OpSpec, Strictness};
pub use super::suite::ConformanceSuite;
use crate::spec::minimums::{MIN_BOUNDARY_VALUES, MIN_EQUIVALENCE_CLASSES};
#[inline]
pub fn validate_minimum_coverage(op: &crate::OpSpec) -> Result<(), String> {
if op.boundary_values.len() < MIN_BOUNDARY_VALUES {
return Err(format!(
"Fix: op '{}' has {} boundary values, minimum is {}.\n\
Add boundary values covering zero, one, max, and at least one\n\
domain-specific edge case.",
op.id,
op.boundary_values.len(),
MIN_BOUNDARY_VALUES
));
}
if op.equivalence_classes.len() < MIN_EQUIVALENCE_CLASSES {
return Err(format!(
"Fix: op '{}' has {} equivalence classes, minimum is {}.\n\
Add at least one equivalence class describing the input domain.",
op.id,
op.equivalence_classes.len(),
MIN_EQUIVALENCE_CLASSES
));
}
Ok(())
}