add #2341 test to lib_machine.rs

This commit is contained in:
Mark
2024-02-29 15:12:58 -07:00
parent b70f121e46
commit f2d3779fa9

View File

@@ -609,4 +609,25 @@ mod tests {
Err(String::from("error existence_error procedure / non_existent_predicate 3 / non_existent_predicate 3"))
);
}
#[test]
fn issue_2341() {
let mut machine = Machine::new_lib();
machine.load_module_string(
"facts",
String::from(
r#"
male(stephen).
parent(albert,edward).
father(F,C):-parent(F,C),male(F).
"#,
),
);
let query = String::from(r#"father(F,C)."#);
let output = machine.run_query(query);
assert_eq!(output, Ok(QueryResolution::False));
}
}