commit 86a897aa6078f12c48ca04f9456a481cfae7a957
parent 2c5d21b44b08d04a9df3c70281ca7ce535902a2b
Author: triesap <tyson@radroots.org>
Date: Sun, 21 Jun 2026 11:47:06 +0000
coverage: test simplex crate exclusion
Diffstat:
1 file changed, 55 insertions(+), 0 deletions(-)
diff --git a/crates/xtask/src/contract.rs b/crates/xtask/src/contract.rs
@@ -4629,6 +4629,61 @@ pub enum RadrootsCoreUnitDimension {
}
#[test]
+ fn coverage_required_workspace_crates_excludes_simplex_packages() {
+ let root = temp_root("coverage_required_workspace_simplex");
+ write_file(
+ &root.join("Cargo.toml"),
+ r#"[workspace]
+members = ["crates/a", "crates/radroots_simplex_probe", "crates/simplex_probe"]
+resolver = "2"
+"#,
+ );
+ write_file(
+ &root.join("crates").join("a").join("Cargo.toml"),
+ r#"[package]
+name = "radroots_a"
+version = "0.1.0"
+edition = "2024"
+"#,
+ );
+ write_file(
+ &root
+ .join("crates")
+ .join("radroots_simplex_probe")
+ .join("Cargo.toml"),
+ r#"[package]
+name = "radroots_simplex_probe"
+version = "0.1.0"
+edition = "2024"
+"#,
+ );
+ write_file(
+ &root.join("crates").join("simplex_probe").join("Cargo.toml"),
+ r#"[package]
+name = "simplex_probe"
+version = "0.1.0"
+edition = "2024"
+"#,
+ );
+
+ let required =
+ coverage_required_workspace_crates(&root).expect("workspace coverage crates");
+ assert_eq!(
+ required,
+ ["radroots_a".to_string()]
+ .into_iter()
+ .collect::<BTreeSet<_>>()
+ );
+ assert!(coverage_policy_excludes_workspace_crate(
+ "radroots_simplex_probe"
+ ));
+ assert!(coverage_policy_excludes_workspace_crate("simplex_probe"));
+ assert!(!coverage_policy_excludes_workspace_crate("radroots_a"));
+
+ let _ = fs::remove_dir_all(root);
+ }
+
+ #[test]
fn coverage_required_crates_match_policy_required_status() {
let root = workspace_root();
let contract_root = root.join("spec");