From 77ce5a9586658e9ccdac1ad9af42c8bfdd0cc572 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Tue, 5 Dec 2023 15:00:07 +0100 Subject: [PATCH] Result with one empty match should be false --- src/machine/lib_machine.rs | 2 +- src/machine/parsed_results.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine/lib_machine.rs b/src/machine/lib_machine.rs index 240f1777..23f8738c 100644 --- a/src/machine/lib_machine.rs +++ b/src/machine/lib_machine.rs @@ -355,7 +355,7 @@ mod tests { ); let result = machine.run_query(String::from("subject_class(X, _).")); - assert_eq!(result, Ok(QueryResolution::True)); + assert_eq!(result, Ok(QueryResolution::False)); } #[test] diff --git a/src/machine/parsed_results.rs b/src/machine/parsed_results.rs index 24dccc5e..bbc9b091 100644 --- a/src/machine/parsed_results.rs +++ b/src/machine/parsed_results.rs @@ -65,11 +65,11 @@ impl From> for QueryResolution { } } - // If there is only one line, and it is an empty match, return true. + // If there is only one line, and it is an empty match, return false. if query_result_lines.len() == 1 { if let QueryResolutionLine::Match(m) = query_result_lines[0].clone() { if m.is_empty() { - return QueryResolution::True; + return QueryResolution::False; } } } -- 2.54.0