Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-mv/blob/main/rust/crates/interplane-conformance/tests/negative_controls.rs # interplane-mv INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-mv / rust / crates / interplane-conformance / tests / negative_controls.rs` 51 lines ยท 1332 bytes Raw Blame History 1 //! Negative controls (bench/PROTOCOL-0.3.md section 6): only with `--features negative-controls`. 2 #![cfg(feature = "negative-controls")] 3 use std::path::PathBuf; 4 5 use interplane_conformance::negctl::{matrix, Variant}; 6 7 fn root() -> PathBuf { 8 PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../../conformance") 9 } 10 11 #[test] 12 fn unmodified_runner_passes_everything() { 13 let m = matrix( 14 &root().join("fixtures"), 15 &root().join("negative-controls.json"), 16 ) 17 .unwrap(); 18 assert_eq!(m["baseline_failed"], serde_json::json!([])); 19 } 20 21 #[test] 22 fn every_variant_turns_a_pass_into_a_detected_failure() { 23 let m = matrix( 24 &root().join("fixtures"), 25 &root().join("negative-controls.json"), 26 ) 27 .unwrap(); 28 assert_eq!(m["valid"], serde_json::json!(true), "{m}"); 29 for v in Variant::ALL { 30 let row = &m["variants"][v.name()]; 31 assert_eq!( 32 row["detected"], 33 serde_json::json!(true), 34 "{}: {row}", 35 v.name() 36 ); 37 assert!( 38 !row["failed"].as_array().unwrap().is_empty(), 39 "{}", 40 v.name() 41 ); 42 } 43 } 44 45 #[test] 46 fn variant_names_round_trip() { 47 for v in Variant::ALL { 48 assert_eq!(Variant::parse(v.name()), Some(v)); 49 } 50 assert_eq!(Variant::parse("V9"), None); 51 }