From: Mark Thom Date: Fri, 23 Feb 2018 23:43:12 +0000 (-0700) Subject: add more tests. X-Git-Tag: v0.8.110~554 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=ec276a7766f49d4b1e63939dfa412e793bc19b14;p=scryer-prolog.git add more tests. --- diff --git a/src/tests.rs b/src/tests.rs index 2d325bd3..b443515b 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1551,4 +1551,16 @@ fn test_queries_on_call_with_inference_limit() ["R = true", "X = 4", "S = true"], ["R = true", "X = 5", "S = true"], ["R = inference_limit_exceeded", "S = !", "X = _1"]]); + assert_prolog_success!(&mut wam, "?- call_with_inference_limit(g(X), 2, R), call_with_inference_limit(g(X), 1, S).", + [["R = true", "X = 1", "S = !"], + ["R = true", "X = 2", "S = !"], + ["R = true", "X = 3", "S = !"], + ["R = true", "X = 4", "S = !"], + ["R = true", "X = 5", "S = !"], + ["R = !", "X = 6", "S = !"]]); + assert_prolog_success!(&mut wam, "?- call_with_inference_limit(g(X), 2, R), call_with_inference_limit(g(X), 1, R).", + [["R = !", "X = 6"]]); + assert_prolog_success!(&mut wam, "?- call_with_inference_limit(g(X), 1, R), call_with_inference_limit(g(X), 1, R).", + [["R = inference_limit_exceeded", "X = _1"]]); + }