add setup_call_cleanup tests, expand builtins tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
:- use_module(library(lists)).
|
||||
:- use_module(library(non_iso)).
|
||||
|
||||
test_queries_on_builtins :-
|
||||
\+ atom(_),
|
||||
@@ -20,7 +21,7 @@ test_queries_on_builtins :-
|
||||
atomic(0.0),
|
||||
\+ atomic([a,b,c]),
|
||||
\+ atomic(atop(the_trees)),
|
||||
( var(X), X = 3, atomic(X) ),
|
||||
findall(X, ( var(X), X = 3, atomic(X) ), [3]),
|
||||
\+ ( var(X), X = 3, var(X) ),
|
||||
arg(1, f(a,b,c,d), a),
|
||||
arg(2, f(a,b,c,d), b),
|
||||
@@ -36,7 +37,6 @@ test_queries_on_builtins :-
|
||||
length([a,b,c], 3),
|
||||
copy_term([[[[X,Y],Y],X]],[[[[Z,V],V],Z]]),
|
||||
\+ ( X = g(X,Y), Y = f(X), copy_term(Y,g(Z)) ),
|
||||
(X = g(X,Y), Y = f(X), copy_term(Y,f(Z))),
|
||||
float(3.14159269),
|
||||
\+ float(3),
|
||||
\+ float("sdfsa"),
|
||||
@@ -44,7 +44,7 @@ test_queries_on_builtins :-
|
||||
\+ float([1,2,3]),
|
||||
\+ float([1,2,_]),
|
||||
\+ (X is 3 rdiv 4, float(X)),
|
||||
( X is 3 rdiv 4, rational(X) ),
|
||||
\+ \+ (X is 3 rdiv 4, rational(X)),
|
||||
\+ rational(3),
|
||||
\+ rational(f(_)),
|
||||
\+ rational("sdfa"),
|
||||
@@ -59,6 +59,71 @@ test_queries_on_builtins :-
|
||||
\+ compound(3.14159269),
|
||||
\+ compound(3),
|
||||
\+ compound("sdfsa"),
|
||||
\+ compound(atom).
|
||||
\+ compound(atom),
|
||||
\+ string(functor(string)),
|
||||
\+ string(3.14159269),
|
||||
\+ string(3),
|
||||
\+ string(f(X)),
|
||||
string("sdfsa"),
|
||||
\+ string(atom),
|
||||
\+ string([1,2,3]),
|
||||
\+ string([1,2,X]),
|
||||
\+ \+ ( X = nonvar, nonvar(X) ),
|
||||
\+ nonvar(X),
|
||||
\+ \+ nonvar(f(X)),
|
||||
nonvar(functor(nonvar)),
|
||||
nonvar(3.14159269),
|
||||
nonvar(3),
|
||||
nonvar("sdfsa"),
|
||||
nonvar(atom),
|
||||
nonvar([1,2,3]),
|
||||
\+ \+ nonvar([1,2,X]),
|
||||
\+ \+ (A = f(A), ground(f(f(A))),ground(f(A)),ground(A)),
|
||||
\+ (B = f(A),ground(B)),
|
||||
\+ (B = f(A),ground(A)),
|
||||
\+ \+ ( ground(x),ground(f(x)),X = f(x),ground(g(f(X),[a,b])) ),
|
||||
\+ \+ (A = f(A),g(A,B) == g(f(A),B)),
|
||||
\+ (A = f(A),g(A,B) == g(f(A),b)),
|
||||
\+ (A == B),
|
||||
\+ (A == 12.1),
|
||||
\+ \+ (X = x,f(X,x) == f(x,X)),
|
||||
\+ (A = f(A),g(A,B) \== g(f(A),B)),
|
||||
\+ \+ (A = f(A),g(A,B) \== g(f(A),b)),
|
||||
\+ \+ (A \== B),
|
||||
\+ \+ (A \== 12.1),
|
||||
\+ (X = x,f(X,x) \== f(x,X)),
|
||||
\+ \+ (X @=< Y),
|
||||
\+ (X @>= Y),
|
||||
\+ (X @> Y),
|
||||
\+ \+ (X @>= X),
|
||||
\+ (atom @=< "string"),
|
||||
\+ \+ (atom @=< atom),
|
||||
\+ (atom @=< aaa),
|
||||
\+ \+ (atom @>= "string"),
|
||||
\+ \+ (X is 3 + 3,X @>= Y),
|
||||
\+ \+ (f(X) @>= f(X)),
|
||||
\+ \+ (f(X) @>= a),
|
||||
\+ (f(X) @=< a),
|
||||
[1,2] @=< [1,2],
|
||||
\+ ([1,2,3] @=< [1,2]),
|
||||
\+ \+ ([] @=< [1,2]),
|
||||
\+ ([] @< 1),
|
||||
\+ ([] @< "string"),
|
||||
\+ ([] @< atom),
|
||||
atom @< [],
|
||||
1.1 @< 1,
|
||||
1.0 @=< 1,
|
||||
1 @=< 1.0,
|
||||
\+ \+ (variant(X, Y)),
|
||||
\+ (variant(f(X), f(x))),
|
||||
\+ \+ (variant(X, X)),
|
||||
\+ \+ (variant(f(x), f(x))),
|
||||
\+ (variant([X,Y,Z], [V,W,V])),
|
||||
\+ \+ (variant([X,Y,Z], [V,W,Z])),
|
||||
\+ \+ (variant([X,Y,X], [V,W,V])),
|
||||
\+ \+ (g(B) = B, g(A) = A, variant(A, B)),
|
||||
keysort([1-1,1-1],[1-1,1-1]),
|
||||
findall(Sorted, keysort([2-99,1-a,3-f(_),1-z,1-a,2-44],Sorted), [[1-a,1-z,1-a,2-99,2-44,3-f(_)]]),
|
||||
findall(X, keysort([X-1,1-1],[2-1,1-1]), [2]).
|
||||
|
||||
:- initialization(test_queries_on_builtins).
|
||||
|
||||
Reference in New Issue
Block a user