rackunit
rackunit copied to clipboard
Checks for sequences
It would be nice to have some custom checks that simplify assertions made on sequences.
-
(check-contains? seq expected ...)For eachexpected, assert thatseqcontains at least one value that is equal to theexpected. Maybe include a keyword argument to enforce order. -
(check-contains-exactly? seq expected ...)Likecheck-contains?, but ifseqhas any extra values then the assertion is failed. -
(check-has-size? seq expected)Same as(check-equal? (sequence-length seq) expected).
This would also help teach people that the "actual" value goes on the left, and the "expected" value(s) go on the right.