28 Extensions for typed/rackunit
(require phc-toolkit/typed-rackunit-extensions) | |
package: phc-toolkit |
syntax
(check-ann value type)
value = (ExpressionOf type) type = Type
TODO: do the check at run-time, like check-tc.
syntax
(check-tc . body)
TODO: fix possible problems with source location when the test fails.
syntax
(check-not-tc . body)
TODO: fix possible problems with source location when the test fails.
procedure
(check-equal?-classes class ...) → Void
class : (∀ (A) (Pairof String (Listof A)))
The car of each class indicates its name, and the rest is a list of element which belong to that class. All elements of the same class should have the same type Aᵢ, but elements of two different classes can have different types Aᵢ and Aⱼ.
This function checks that all elements of the same class are equal?, and that any two elements of two distinct classes are different. It also checks that elements are equal to themeselves, and checks equalities and inequalities in both directions, i.e. (and (equal? a b) (equal? b a)) for equalities, and (and (not (equal? a b)) (not (equal? b a))) for inequalities.
Be aware that this function has O(n{}^2) time complexity, with n being the total number of elements in all classes.
syntax
(check-equal?-classes: [maybe-nameᵢ maybe-typeᵢ elementᵢⱼ ...] ...)
maybe-nameᵢ =
| #:name String maybe-typeᵢ =
| : tᵢ tᵢ = Type elementᵢⱼ = (ExpressionOf tᵢ or Any)
28.1 Untyped versions of typed-rackunit-extensions
(require phc-toolkit/untyped/typed-rackunit-extensions) | |
package: phc-toolkit |