From: Nicolas Luck Date: Mon, 29 Jan 2024 14:26:06 +0000 (+0100) Subject: Minimal reproduction of faulty behaviour seen in integration tests X-Git-Tag: v0.9.4~3^2~26 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=2e728c7051b621dce4fe2f180f271665e0952cb0;p=scryer-prolog.git Minimal reproduction of faulty behaviour seen in integration tests --- diff --git a/src/machine/lib_machine.rs b/src/machine/lib_machine.rs index d355ee7e..6756a953 100644 --- a/src/machine/lib_machine.rs +++ b/src/machine/lib_machine.rs @@ -533,4 +533,27 @@ mod tests { ),])) ); } + + #[test] + fn dont_return_partial_matches() { + let mut machine = Machine::new_lib(); + + machine.consult_module_string( + "facts", + String::from( + r#" + :- discontiguous(property_resolve/2). + subject_class("Todo", c). + "#, + ), + ); + + let query = + String::from(r#"subject_class("Todo", C), property_resolve(C, "isLiked")."#); + let output = machine.run_query(query); + assert_eq!( + output, + Ok(QueryResolution::False) + ); + } }