use super::*;
#[test]
fn test_slot_outside_property_is_rejected() {
let predicates = vec![Predicate::Root("beautiful".into())];
let arguments = vec![Argument::Marker(Marker::Slot)];
let proposition = Proposition {
relation: 0,
terms: vec![0],
x1_present: true,
negated: false,
tense: None,
deontic: None,
};
let (form, compiler) = compile_one(predicates, arguments, proposition);
assert!(
compiler
.errors
.iter()
.any(|e| e.contains("`slot` outside a `property")),
"bare slot must accumulate a semantic error, got: {:?}",
compiler.errors
);
let x1_args = get_pred_args(&form, "beautiful_x1", &compiler)
.expect("expected beautiful_x1 role predicate");
assert!(
matches!(&x1_args[1], IrTerm::Unspecified),
"rejected slot compiles to Unspecified (no free variable), got {:?}",
x1_args[1]
);
}