From 70adce40b6586f1c597ade69a257faab40bd1015 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 31 Mar 2021 19:04:01 -0400 Subject: [PATCH] WIP - Added partial docs --- docs/api/cyclone/test.md | 70 +++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/docs/api/cyclone/test.md b/docs/api/cyclone/test.md index f921f53f..028e95e4 100644 --- a/docs/api/cyclone/test.md +++ b/docs/api/cyclone/test.md @@ -2,54 +2,88 @@ The `(cyclone test)` library contains a testing framework ported from `(chibi test)` which in turn was ported from CHICKEN. +## Exception Utilities - [`warning`](#warning) -- [`test-group-inc!`](#test-group-inc) -- [`print-exception`](#print-exception) + +## Test Interface - [`test`](#test) + - [`test-equal`](#test-equal) - [`test-error`](#test-error) - [`test-assert`](#test-assert) - [`test-not`](#test-not) - [`test-values`](#test-values) -- [`test-group`](#test-group) -- [`current-test-group`](#current-test-group) - [`test-begin`](#test-begin) - [`test-end`](#test-end) -- [`test-syntax-error`](#test-syntax-error) - [`test-propagate-info`](#test-propagate-info) - [`test-vars`](#test-vars) - [`test-run`](#test-run) - [`test-exit`](#test-exit) + +## Group Interface +- [`test-group`](#test-group) +- [`test-group-inc!`](#test-group-inc) + +## Utilities +- [`test-syntax-error`](#test-syntax-error) + +## Parameters +- [`current-test-group`](#current-test-group) - [`current-test-verbosity`](#current-test-verbosity) - [`current-test-applier`](#current-test-applier) - [`current-test-handler`](#current-test-handler) - [`current-test-skipper`](#current-test-skipper) - [`current-test-group-reporter`](#current-test-group-reporter) -- [`test-failure-count`](#test-failure-count) - [`current-test-epsilon`](#current-test-epsilon) - [`current-test-comparator`](#current-test-comparator) +- [`test-failure-count`](#test-failure-count) # warning -# test-group-inc! - -# print-exception + (warning msg . args) # test +*Syntax* + + (test [name] expect expr) + +Evaluate `expr` and check that it is `equal?` to `expect`. + +`name` is used in reporting, and defaults to a printed summary of `expr`. + # test-equal +;;> \macro{(test-equal equal [name] expect expr)} + +;;> Equivalent to test, using \var{equal} for comparison instead of +;;> \scheme{equal?}. + # test-error +;;> \macro{(test-error [name] expr)} + +;;> Like \scheme{test} but evaluates \var{expr} and checks that it +;;> raises an error. + # test-assert +;;> \macro{(test-assert [name] expr)} + +;;> Like \scheme{test} but evaluates \var{expr} and checks that it's true. + # test-not +;;> \macro{(test-not [name] expr)} + +;;> Like \scheme{test} but evaluates \var{expr} and checks that it's false. + # test-values -# test-group +;;> \macro{(test-values [name] expect expr)} -# current-test-group +;;> Like \scheme{test} but \var{expect} and \var{expr} can both +;;> return multiple values. # test-begin @@ -65,6 +99,18 @@ The `(cyclone test)` library contains a testing framework ported from `(chibi te # test-exit + (test-exit) + +Exits with a failure status if any tests have failed, and a successful status otherwise. + +# test-group + + (test-group body ...) + +Wraps `body` as a single test group, which can be filtered and summarized separately. + +# current-test-group + # current-test-verbosity # current-test-applier @@ -81,3 +127,5 @@ The `(cyclone test)` library contains a testing framework ported from `(chibi te # current-test-comparator +# test-group-inc! +