use contextgraph_conformance::{
CheckStatus, HCHECK_BUDGET_DROP, HCHECK_COMPOSITION_AUDIT, HCHECK_CONSENT_GATE,
HCHECK_CONTENT_QUOTING, HCHECK_CRASH_ISOLATION, HCHECK_FRAME_LIMIT, HCHECK_PROVENANCE_BYTES,
HCHECK_SCOPE_RECEIPT, HCHECK_VERSION_REJECT, run_host_conformance,
};
#[tokio::test]
async fn the_reference_host_upholds_every_host_binding_rule() {
let report = run_host_conformance().await;
assert!(
report.passed(),
"the reference host must be conformant; failures: {:?}",
report.failures().collect::<Vec<_>>()
);
assert_eq!(report.checks.len(), 9);
for name in [
HCHECK_VERSION_REJECT,
HCHECK_BUDGET_DROP,
HCHECK_FRAME_LIMIT,
HCHECK_CONSENT_GATE,
HCHECK_SCOPE_RECEIPT,
HCHECK_PROVENANCE_BYTES,
HCHECK_CONTENT_QUOTING,
HCHECK_COMPOSITION_AUDIT,
HCHECK_CRASH_ISOLATION,
] {
let status = report
.checks
.iter()
.find(|check| check.name == name)
.unwrap_or_else(|| panic!("report is missing the `{name}` check"))
.status;
assert_eq!(status, CheckStatus::Pass, "{name}: {report:?}");
}
}