]> Repositorios git - scryer-prolog.git/commitdiff
Result with one empty match should be false
authorNicolas Luck <[email protected]>
Tue, 5 Dec 2023 14:00:07 +0000 (15:00 +0100)
committerNicolas Luck <[email protected]>
Tue, 5 Dec 2023 14:00:07 +0000 (15:00 +0100)
src/machine/lib_machine.rs
src/machine/parsed_results.rs

index 240f1777c2f35b6efa24aeccf270783d59b0125a..23f8738cd5e4bcbf6a51ae7811916355338c7e91 100644 (file)
@@ -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]
index 24dccc5e6c3e7c4ec12ad4c1c233af54b7d97df4..bbc9b0912ba368a23c8e7cbeadfd5733ee5e9543 100644 (file)
@@ -65,11 +65,11 @@ impl From<Vec<QueryResolutionLine>> 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;
                 }
             }
         }