mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
2.01k stars 117 forks source link

Auto-generating tests #2380

Open adjivas opened 5 months ago

adjivas commented 5 months ago

Hello,

swi-prolog has a test-wizard module for auto-generating the tests

Do scryer-prolog has a equivalent?

Thank's by advance for the anwser :)

UWN commented 5 months ago

swi-prolog has ... Do scryer-prolog has a equivalent?

Hopefully, we will soon have a better system that avoids SWI's fallacies like (in 9.3.3):

?- member(X,[Y]).
   X = Y.

which generates the test

test(member, [true(A-B==C-C), nondet]) :-
    member(A, [B]).

resulting in

ERROR:     test lists:member: 
ERROR: wrong answer (compared using ==)
ERROR:     Expected: A-A
ERROR:     Got:      B-B

Not only is the error here misleading, also the use of a different notation for testing seems to be inherently cumbersome.