Skip to content

Commit

Permalink
Result with one empty match should be false
Browse files Browse the repository at this point in the history
  • Loading branch information
lucksus committed Dec 5, 2023
1 parent 24e3e17 commit 77ce5a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/machine/lib_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/machine/parsed_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 77ce5a9

Please sign in to comment.