<cobbe at ccs dot neu dot edu>
This software is distributed under a BSD-style license (see license.txt).
This package provides one file, check-values.ss, which defines two macros.
These macros make it easier to write SchemeUnit test cases for functions
and other forms that return multiple values.
> (check-values actual ((same? expected) ...) [msg])
This macro checks an expression that produces multiple values. The first
argument, actual, is the expression to be tested. Unlike the other checks
in SchemeUnit, this is a macro, and you should *NOT* wrap actual in a
thunk! The sequence of (same? expected) lists specify the values that
actual should produce, along with the predicate to be used to compare the
(check-values actual ((same_1 expected_1) ... (same_n expected_n)))
succeeds if actual produces values v_1 through v_n and if
(check same_i v_i expected_i)
succeeds for all i between 1 and n.
As with other SchemeUnit checks, this form accepts an optional message
If the check fails, it fails with a message that contains the original
message, if any, and indicate the cause of the error: if actual produced
the wrong number of values, or which produced value failed to match the
corresponding expected value.
> (check-values* same? actual (expected ...) [msg])
This macro is an optimization of check-values for the case in which all
values are to be compared with the same equality predicate.
(check-values* EQ EXPR (V1 ...))
expands (roughly) to
(check-values EXPR ((EQ V1) ...))
Carl Eastlund suggested (and I think implemented the initial draft of) the
generalization from check-values* to check-values.