-
✓ works with managed PostgreSQL (does not require native extensions)
-
✓ lots of matchers
-
✓ nice console outputs
First specify a test inside test
schema like this:
link:./examples/my_first_test.sql[role=include]
Then run all tests with:
link:./run_all_tests.sql[role=include]
-
lib_test.assert_true(condition boolean)
-
lib_test.assert_true(message varchar, condition boolean)
-
lib_test.assert_false(condition boolean)
-
lib_test.assert_equal(left boolean, right boolean, message varchar default '')
-
lib_test.assert_equal(left integer, right integer, message varchar default '')
-
lib_test.assert_equal(left text, right text, message varchar default '')
-
lib_test.assert_equal(left jsonb, right jsonb, message varchar default '')
-
lib_test.assert_equal(left timestamptz, right timestamptz, message varchar default '')
-
lib_test.assert_equal(left uuid, right uuid, message varchar default '')
-
lib_test.assert_not_equal(left text, right text, message varchar default '')
-
lib_test.assert_null(val$ anyelement, message$ text default '')
-
lib_test.assert_not_null(val$ anyelement, message$ text default '')
-
lib_test.fail(varchar)
See ./matches.sql[matches]
-
pgunit for the inspiration and base code
Code is written following standard SQL-convention.