plunit_assert

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.

API Documentation

The API documentation is generated by PlDoc and the latest is always available here:

https://simonharris.github.io/plunit_assert/

Installation

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)).

Prolog files

plunit_assert.pl  -- The test API for plunit_assert
assert_equals/2This is a superset of assert_is/2 and arithmetic comparison with =:=.
assert_exception/1Test that an exception is thrown during the invocation of Goal.
assert_false/1Test that Goal fails and therefore is falsy.
assert_gt/2Test that A is greater than B.
assert_gte/2Test that A is greater than or equal to B.
assert_in/2Test that Var is in Collection.
assert_is/2Test that A and B are identical terms.
assert_is_not/2Test that A and B are not identical terms.
assert_lt/2Test that A is less than B.
assert_lte/2Test that A is less than or equal to B.
assert_not_equals/2Test that A and B are not equal terms.
assert_not_in/2Test that Var is not in Collection.
assert_not_type/2Test that Var is not of type Type.
assert_not_unbound/1Test that Var is not unbound.
assert_output/3Test that a predicate's output arguments match what is expected.
assert_test_fails/1Meta test to check that Goal would trigger a PlUnit test fail.
assert_test_passes/1Meta test to check that Goal would not trigger a PlUnit test fail.
assert_true/1Test that Goal succeeds and therefore is truthy.
assert_type/2Test that Var is of type Type.
assert_unbound/1Test that Var is unbound.