-- -- https://en.wikipedia.org/wiki/Eating_your_own_dog_food -- BEGIN; CREATE SCHEMA doctest; CREATE EXTENSION pgtap; CREATE EXTENSION pg_doctest WITH SCHEMA doctest; SELECT plan(9); plan ------ 1..9 (1 row) SELECT doctest.doctest_runtests('doctest',NULL); doctest_runtests ----------------------------------------------------------------------------------------------------------------------------- # doctests for doctest.doctest_check(text,text) ok 2 - SELECT doctest.doctest_check('SELECT 40 + 2','42') LIKE 'ok%'; # doctests for doctest.doctest_parse_expected(text) ok 3 - SELECT doctest.doctest_parse_expected(NULL); ok 4 - SELECT doctest.doctest_parse_expected('-- 42 '); ok 5 - SELECT doctest.doctest_parse_expected('This is not a comment'); # doctests for doctest.doctest_parse_function_body(oid) ok 6 - SELECT doctest.doctest_parse_function_body( 'doctest.doctest_parse_function_body(oid)'::REGPROCEDURE ) IS NOT NULL; # doctests for doctest.doctest_parse_query(text) ok 7 - SELECT doctest.doctest_parse_query(NULL); ok 8 - SELECT doctest.doctest_parse_query('-- >>> SELECT 40 + 2 '); ok 9 - SELECT doctest.doctest_parse_query('-- This is not a doctest line'); (12 rows) SELECT finish(); finish -------- (0 rows) ROLLBACK;