This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/plunit/examples/simple.pl
2009-12-04 10:59:38 +00:00

38 lines
481 B
Prolog

:- module(ex_simple, []).
:- use_module(library(plunit)).
:- begin_tests(lists).
test(true) :-
true.
test(fail) :-
\+ fail.
test(fail, [fail]) :-
fail.
test(member) :-
member(a, [a]), !.
test(member, [nondet]) :-
member(_, [a]).
test(member, [true(X == a)]) :-
member(X, [a]), !.
test(member, [all(V == [a,b,c])]) :-
member(V, [a,b,c]).
test(append) :-
append("aap", "noot", X),
X == "aapnoot".
:- end_tests(lists).
:- run_tests.
:- run_tests(lists:member).