add more tests

This commit is contained in:
Mark Thom
2018-02-22 18:33:00 -07:00
parent bdd4fe6eb3
commit 5c5257bdbd
2 changed files with 14 additions and 9 deletions

View File

@@ -1449,7 +1449,6 @@ fn test_queries_on_call_with_inference_limit()
{ {
let mut wam = Machine::new(); let mut wam = Machine::new();
// inference_limit_exceeded thrown on 0 limit.
assert_prolog_success!(&mut wam, "?- call_with_inference_limit(throw(error), 0, R).", assert_prolog_success!(&mut wam, "?- call_with_inference_limit(throw(error), 0, R).",
[["R = inference_limit_exceeded"]]); [["R = inference_limit_exceeded"]]);
assert_prolog_success!(&mut wam, "?- catch(call_with_inference_limit(throw(error), 1, R), assert_prolog_success!(&mut wam, "?- catch(call_with_inference_limit(throw(error), 1, R),
@@ -1466,6 +1465,12 @@ fn test_queries_on_call_with_inference_limit()
["R = true", "X = 3"], ["R = true", "X = 3"],
["R = true", "X = 4"], ["R = true", "X = 4"],
["R = !", "X = 5"]]); ["R = !", "X = 5"]]);
assert_prolog_success!(&mut wam, "?- call_with_inference_limit(g(X), 5, R), call(true).",
[["R = true", "X = 1"],
["R = true", "X = 2"],
["R = true", "X = 3"],
["R = true", "X = 4"],
["R = !", "X = 5"]]);
assert_prolog_success!(&mut wam, "?- call_with_inference_limit(g(X), 2, R).", assert_prolog_success!(&mut wam, "?- call_with_inference_limit(g(X), 2, R).",
[["R = true", "X = 1"], [["R = true", "X = 1"],
["R = true", "X = 2"], ["R = true", "X = 2"],