use std::path::PathBuf;
#[test]
fn engine_probe_fixture_matches_embedder_source_of_truth() {
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let engine_copy = manifest.join("src/vector_equivalence_probes.txt");
let canonical =
manifest.join("../fathomdb-embedder/tests/fixtures/candle_onnx_equivalence_probes.txt");
let engine_bytes = std::fs::read(&engine_copy)
.unwrap_or_else(|e| panic!("read engine copy {engine_copy:?}: {e}"));
let canonical_bytes = std::fs::read(&canonical)
.unwrap_or_else(|e| panic!("read canonical fixture {canonical:?}: {e}"));
assert_eq!(
engine_bytes, canonical_bytes,
"engine `src/vector_equivalence_probes.txt` must stay byte-identical to the \
embedder crate's `candle_onnx_equivalence_probes.txt` (drift guard)"
);
let text = String::from_utf8(canonical_bytes).unwrap();
let count = text
.lines()
.filter(|l| {
let t = l.trim_start();
!t.is_empty() && !t.starts_with('#')
})
.count();
assert_eq!(count, 45, "the committed probe set must be exactly 45 probes");
}