Skip to main content

Prolog

Status

Beta

Versions

SWI Prolog v8.0

Test Frameworks

plunit

Example

plunit can be used normally.

add_1(X,Y) :- Y is X+1.
add_1(X,Y) :- Y is X+1.
:- begin_tests(solution).
:- include(solution).

test(add_1) :-
        add_1(1, X),
        assertion(X == 2).

:- end_tests(solution).
:- begin_tests(solution).
:- include(solution).

test(add_1) :-
        add_1(1, X),
        assertion(X == 2).

:- end_tests(solution).

The name of the solution module is inferred from the test file using the line :- begin_tests(example).. Optional preloaded code is written to preloaded.pl.

Timeout

12 seconds

Packages

None

Services

None

Language ID

prolog