use crate::OpSpec;
use vyre_spec::Category;
use super::error::CoverageError;
pub(super) fn check_category(spec: &OpSpec, errors: &mut Vec<CoverageError>) {
match &spec.category {
Category::A { composition_of } => {
if composition_of.is_empty() {
errors.push(CoverageError::UnclassifiedCategory {
op_id: spec.id.to_string(),
});
}
}
Category::C { hardware, .. } => {
if hardware.trim().is_empty() {
errors.push(CoverageError::MissingCategoryCHardware {
op_id: spec.id.to_string(),
});
}
}
_ => {}
}
}