21 lines
902 B
Rust
21 lines
902 B
Rust
//! Sink energy (extensions/sink-energy.md): the committed corpus regenerates byte for byte
|
|
//! from its fixed seeds, wai-rs gives every case the outcome it states, every reason of §8
|
|
//! refuses at least one case, and every measured table under `tables/` is accepted with its
|
|
//! readings and its procedure.
|
|
|
|
use std::path::Path;
|
|
use wai::sink_energy::corpus;
|
|
|
|
const DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../live-conformance/sink-energy");
|
|
|
|
#[test]
|
|
fn the_corpus_regenerates_byte_for_byte() {
|
|
let committed = std::fs::read_to_string(Path::new(DIR).join("vectors.json")).expect("vectors.json is committed");
|
|
assert!(committed == corpus::generate(), "vectors.json does not regenerate; run wai_sink_energy_vectors gen");
|
|
}
|
|
|
|
#[test]
|
|
fn every_case_every_reason_and_every_measured_table() {
|
|
let fails = corpus::verify(Path::new(DIR));
|
|
assert!(fails.is_empty(), "{fails:#?}");
|
|
}
|