Skip to content

Commit

Permalink
add #2341 test to lib_machine.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mthom committed Feb 29, 2024
1 parent b70f121 commit f2d3779
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/machine/lib_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,4 +609,25 @@ mod tests {
Err(String::from("error existence_error procedure / non_existent_predicate 3 / non_existent_predicate 3"))
);
}

#[test]
fn issue_2341() {
let mut machine = Machine::new_lib();

machine.load_module_string(
"facts",
String::from(
r#"
male(stephen).
parent(albert,edward).
father(F,C):-parent(F,C),male(F).
"#,
),
);

let query = String::from(r#"father(F,C)."#);
let output = machine.run_query(query);

assert_eq!(output, Ok(QueryResolution::False));
}
}

0 comments on commit f2d3779

Please sign in to comment.