]> Repositorios git - scryer-prolog.git/commitdiff
add more tests.
authorMark Thom <[email protected]>
Fri, 23 Feb 2018 23:43:12 +0000 (16:43 -0700)
committerMark Thom <[email protected]>
Fri, 23 Feb 2018 23:43:12 +0000 (16:43 -0700)
src/tests.rs

index 2d325bd3c447dd9a9a88b662d821fa56dc079877..b443515bb19ddbd42252d1ff04eb2a951eff812f 100644 (file)
@@ -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"]]);
+    
 }