Did you know ... Search Documentation:
Pack doctest -- prolog/doctest.pl
PublicShow source

This module looks for fenced code blocks (using ~~~ or ==) in PlDoc comments and turns them into unit tests for the PlUnit framework each time there is a query identified by ?-

author
- Sylvain Soliman
license
- BSD-2
 gen_doctests(+File) is det
Same as gen_doctests/2 with default options to File
 gen_doctests(+File, +Options) is det
Generate the tests from the PlDoc of File in TestFile and run them all. Options can contain the outfile(Name) overriding the default adding a 't' to File and the parse_output(true) flag to use the new test maker instead of make_test/3.

The new test maker will try to parse the output of the queries in the code blocks whereas otherwise the query is run using the test_wizard library

File must define a proper module.