I followed the answer suggested in this question How can I test a non-deterministic predicate in any order with PL-Unit? .
test(hello, [
setup(board_1_setup),
cleanup(clear_board),
Ys = [d-6, e-6, f-6, d-5, f-5, e-4, f-4]
]) :- setof(Y, any_turn_king_move(e-5, Y), Ys).
ERROR: /home/eguneys/chess/pro/_chess.plt:10:
test hello: wrong answer (compared using =)
ERROR: Expected: [d-6,e-6,f-6,d-5,f-5,e-4,f-4]
ERROR: Got: [d-5,d-6,e-4,e-6,f-4,f-5,f-6]
If I put them in order the test passes.
Why does this still checks for order, even though I put them in a setof
.