45 lines
1.4 KiB
Rust
45 lines
1.4 KiB
Rust
|
|
//! Conformance suite run against the in-process `MockDnsProvider`.
|
||
|
|
//!
|
||
|
|
//! This validates all 17 invariants without any live server.
|
||
|
|
//! Gated on the `test-support` feature; always enabled in this test file via
|
||
|
|
//! the `#[cfg(feature = "test-support")]` guard.
|
||
|
|
|
||
|
|
#[cfg(feature = "test-support")]
|
||
|
|
mod mock_conformance {
|
||
|
|
use ontoref_dns::conformance::{run_conformance_suite, MockDnsProvider};
|
||
|
|
|
||
|
|
#[tokio::test]
|
||
|
|
async fn mock_provider_passes_all_17_invariants() {
|
||
|
|
let provider = MockDnsProvider::new();
|
||
|
|
let report = run_conformance_suite(provider).await;
|
||
|
|
report.assert_all_pass();
|
||
|
|
}
|
||
|
|
|
||
|
|
#[tokio::test]
|
||
|
|
async fn mock_provider_all_pass_returns_true() {
|
||
|
|
let provider = MockDnsProvider::new();
|
||
|
|
let report = run_conformance_suite(provider).await;
|
||
|
|
assert!(
|
||
|
|
report.all_pass(),
|
||
|
|
"Expected all invariants to pass, got failures: {:?}",
|
||
|
|
report
|
||
|
|
.results
|
||
|
|
.iter()
|
||
|
|
.filter(|r| r.outcome.is_err())
|
||
|
|
.collect::<Vec<_>>()
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
#[tokio::test]
|
||
|
|
async fn mock_provider_has_17_invariant_results() {
|
||
|
|
let provider = MockDnsProvider::new();
|
||
|
|
let report = run_conformance_suite(provider).await;
|
||
|
|
assert_eq!(
|
||
|
|
report.results.len(),
|
||
|
|
17,
|
||
|
|
"Expected 17 invariant results, got {}",
|
||
|
|
report.results.len()
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|