]> Repositorios git - scryer-prolog.git/commitdiff
add tests.
authorMark Thom <[email protected]>
Thu, 3 Aug 2017 17:22:52 +0000 (11:22 -0600)
committerMark Thom <[email protected]>
Thu, 3 Aug 2017 17:22:52 +0000 (11:22 -0600)
src/main.rs

index f98fd34cef9768173fd4503155045202ef39c70b..a4df500cca99b480b2b6c6565635d585143450c8 100644 (file)
@@ -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.");