From 2e728c7051b621dce4fe2f180f271665e0952cb0 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Mon, 29 Jan 2024 15:26:06 +0100 Subject: [PATCH] Minimal reproduction of faulty behaviour seen in integration tests --- src/machine/lib_machine.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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) + ); + } } -- 2.54.0