Version: 5.2
Test Support
1 Using Check Forms
This module provides test forms for use in Racket programs, as well
as parameters to configure the behavior of test reports.
Each check form may only occur at the top-level; results are collected
and reported by the test function. Note that the check forms only
register checks to be performed. The checks are actually run by the
test function.
Checks whether the value of the test expression is structurally
equal to the value produced by the expected expression.
It is an error for test or expected to produce a function
value or an inexact number.
(check-within (test any/c) (expected any/c) (delta number?)) |
Checks whether the value of the test expression is structurally
equal to the value produced by the expected expression; every
number in the first expression must be within delta of the
corresponding number in the second expression.
It is an error for test or expected to produce a function
value.
Checks that evaluating test signals an error, where
the error message matches the string (if any).
Checks whether the value of the test expression is structurally
equal to any of the values produced by the expected expressions.
It is an error for test or any of the expected expression
to produce a function value or an inexact number.
(check-range (test number/c) (min number/c) (max number/c)) |
Checks whether value of test is between the values of the
min and max expressions [inclusive].
Runs all of the tests specified by check forms in the current module
and reports the results. When using the gui module, the results are
provided in a separate window, otherwise the results are printed to
the current output port.
A parameter that stores the formatting function for the values tested
by the check forms.
A parameter that stores a boolean, defaults to #f, that can be used to
suppress the printed summary from test.
A parameter that stores a boolean, defaults to #t, that can be used to
suppress evaluation of test expressions.
2 GUI Interface
This module requires GRacket and produces an independent window when
displaying test results. It provides the same bindings as
test-engine/racket-tests.
3 Integrating languages with Test Engine
(To be written.)