Provides a more expressive API for PlUnit by implementing xUnit-like test predicates such as assert_true/1 and assert_type/2.
A longer-term goal is also that it should provide more helpful failure messages.
The API documentation is generated by PlDoc and the latest is always available here:
https://simonharris.github.io/plunit_assert/
Packages are hosted here:
https://packages.pointbeing.net/plunit_assert/
Thus, the library can currently be installed using:
?- pack_install(plunit_assert, [url('https://packages.pointbeing.net/plunit_assert/plunit_assert-0.1.0.tgz')]).
Once the library is at a more stable release there is a plan to make it discoverable (see [#15](../../issues/15)).
plunit_assert.pl -- The test API for plunit_assert | ||
---|---|---|
assert_equals/2 | This is a superset of assert_is/2 and arithmetic comparison with =:=. | |
assert_exception/1 | Test that an exception is thrown during the invocation of Goal. | |
assert_false/1 | Test that Goal fails and therefore is falsy. | |
assert_gt/2 | Test that A is greater than B. | |
assert_gte/2 | Test that A is greater than or equal to B. | |
assert_in/2 | Test that Var is in Collection. | |
assert_is/2 | Test that A and B are identical terms. | |
assert_is_not/2 | Test that A and B are not identical terms. | |
assert_lt/2 | Test that A is less than B. | |
assert_lte/2 | Test that A is less than or equal to B. | |
assert_not_equals/2 | Test that A and B are not equal terms. | |
assert_not_in/2 | Test that Var is not in Collection. | |
assert_not_type/2 | Test that Var is not of type Type. | |
assert_not_unbound/1 | Test that Var is not unbound. | |
assert_output/3 | Test that a predicate's output arguments match what is expected. | |
assert_test_fails/1 | Meta test to check that Goal would trigger a PlUnit test fail. | |
assert_test_passes/1 | Meta test to check that Goal would not trigger a PlUnit test fail. | |
assert_true/1 | Test that Goal succeeds and therefore is truthy. | |
assert_type/2 | Test that Var is of type Type. | |
assert_unbound/1 | Test that Var is unbound. |