lawsynth/crates/lawsynth-causal/tests/assumptions_integration.rs
2026-08-16 22:04:11 +03:00

13 lines
518 B
Rust

use lawsynth_causal::{AssumptionSet, CausalAssumption, CausalGraph};
#[test]
fn declared_edge_assumption_is_checked_against_graph() {
let mut graph = CausalGraph::new(["treatment", "outcome"]).unwrap();
graph.add_edge("treatment", "outcome").unwrap();
let mut assumptions = AssumptionSet::default();
assumptions.declare(CausalAssumption::NoUnmeasuredConfounding {
cause: "treatment".into(),
effect: "outcome".into(),
});
assert!(assumptions.validate_against(&graph).is_ok());
}