4 API

Guile Probá comes with the proba library, which defines the following modules:

4.1 Module (proba runners)

This module exports the following:

Function: uno filename

Return a custom SRFI 64 test runner that logs test results to the given filename.

This is the default test runner used by Guile Probá’s for running test suites (the name ‘uno‘ is Spanish for ‘one‘).

Parameter: string filename

Absolute path to a file to log detailed results of tests. For example: "/tmp/mylib-test.log". The file will be created if it does not exist.

Return value: runner .

An SRFI 64 test runner.

4.2 Module (proba utils)

This module exports the following:

Function: unit-name unit

Return the name of unit formatted to be used as an SRFI 64 test group name.

> (unit-name string-append)
"[procedure] string-append"

This procedure is to avoid using a string literal as the name of a test group that defines test cases for a specific unit. Instead, the group name is formed using the actual unit symbol, so that it is harder to miss updating it when the unit symbol is renamed in the code, in which case you would see an "unbound variable" message when running the test suite.

Parameter: procedure unit

The name of a testable unit (currently procedures only). For example, Guile’s built-in string-null? procedure.

Return value: string .

A string in the form "[unit-type] unit-name". For example, in the case of Guile’s string-null? procedure, the return value would be "[procedure] string-null?".