From 0050c1d4cbfb3649cba8eb5f1d9a2e90c012a114 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Thu, 3 Aug 2017 11:22:52 -0600 Subject: [PATCH] add tests. --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index f98fd34c..a4df500c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -648,7 +648,13 @@ mod tests { assert_eq!(submit(&mut wam, "?- call_mult(p(two), two)."), true); assert_eq!(submit(&mut wam, "?- call(call(p(one)), X), call(call(p(two)), two)."), true); + assert_eq!(submit(&mut wam, "?- call(call(p(one, X))), call(call(p(two, two)))."), true); assert_eq!(submit(&mut wam, "?- call(call(p(one)), X), call(call(p(two)), one)."), false); + assert_eq!(submit(&mut wam, "?- call(call(p(X)), X), call(call(p(Y)), Y)."), true); + assert_eq!(submit(&mut wam, "?- call(call(p(X)), Y), call(call(p(Y)), X)."), true); + assert_eq!(submit(&mut wam, "?- call(call(p), X, Y), call(call(call(p)), X, Y)."), true); + assert_eq!(submit(&mut wam, "?- call(call(p), X, Y), call(call(call(p(X))), Y)."), true); + assert_eq!(submit(&mut wam, "?- call(call(p), X, Y), call(call(call(p(X))), X, Y)."), false); submit(&mut wam, "f(call(f, undefined)). f(undefined)."); submit(&mut wam, "call_var(P) :- P."); -- 2.54.0