rackunit icon indicating copy to clipboard operation
rackunit copied to clipboard

Checks for sequences

Open jackfirth opened this issue 6 years ago • 0 comments

It would be nice to have some custom checks that simplify assertions made on sequences.

  • (check-contains? seq expected ...) For each expected, assert that seq contains at least one value that is equal to the expected. Maybe include a keyword argument to enforce order.
  • (check-contains-exactly? seq expected ...) Like check-contains?, but if seq has 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.

jackfirth avatar Dec 13 '19 20:12 jackfirth