1.9 Test Cases

► |  | How to Design Programs Languages

1 | Beginning Student
2 | Beginning Student with List Abbreviations
3 | Intermediate Student
4 | Intermediate Student with Lambda
5 | Advanced Student
| Index

▼ | 1 | Beginning Student

1.1 | define
1.2 | define-struct
1.3 | Function Calls
1.4 | Primitive Calls
1.5 | cond
1.6 | if
1.7 | and
1.8 | or
1.9 | Test Cases
1.10 | empty
1.11 | Identifiers
1.12 | Symbols
1.13 | true and false
1.14 | require
1.15 | Primitive Operations

On this page:

check-expect
check-within
check-error
check-member-of
check-range

top← prev up next →

#### 1.9`` Test Cases

( check-expect expr expr)

A test case to check that the first expr produces the same value as the second expr, where the latter is normally an immediate value.

( check-within expr expr expr)

Like check-expect, but with an extra expression that produces a number delta. The test case checks that each number in the result of the first expr is within delta of each corresponding number from the second expr.

( check-error expr expr)

A test case to check that the first expr signals an error, where the error messages matches the string produced by the second expr.

( check-member-of expr expr expr ...)

A test case to check that the first expr produces an element that is equivalent to one of the following exprs.

( check-range expr expr expr)

A test case to check that the first expr produces a number inbetween the numbers produced by the second and third exprs, inclusive.
top← prev up next →