can be written using assertions so that a failing test due to the tested predicate returning a wrong value would provide more information. For example:
test(star1, true(X == 988771) :- day1:star(1, X).
If the day1:star/2 predicate is expected to be deterministic, we can write instead:
Thanks for the suggestions! I'm not going to force "deterministic" yet because I have some flaky code. I'm also very new to the whole Logtalk ecosystem.
Tests such as:
https://github.com/aarroyoc/advent-of-code-2020/blob/b6e92bac83923f648916389ba3f87b77458478cf/test/day1.lgt#L5
can be written using assertions so that a failing test due to the tested predicate returning a wrong value would provide more information. For example:
If the
day1:star/2
predicate is expected to be deterministic, we can write instead:In case of test failure, the
X == 988771
assertion is printed, potentially providing valuable information for debugging.