rackunit icon indicating copy to clipboard operation
rackunit copied to clipboard

run-tests: checks nested inside `define-check`s do not report failures

Open Bogdanp opened this issue 3 years ago • 0 comments

This may just be another instance of https://github.com/racket/rackunit/issues/98 (in which case, feel free to close it in its favor), but I was surprised to find out that the following program reports no failures despite displaying an error:

#lang racket/base

(require rackunit
         rackunit/text-ui)

(define-check (check-example a b)
  (check-equal? a b))

(define suite
  (test-suite
   "example"

   (check-example 1 2)))

(run-tests suite)
$ raco test example.rkt
raco test: "/Users/bogdan/tmp/example.rkt"
--------------------
example > Unnamed test
FAILURE
name:       check-example
location:   example.rkt:13:3
actual:     1
expected:   2
--------------------
1 success(es) 0 failure(s) 0 error(s) 1 test(s) run
0
1 test passed

Bogdanp avatar Dec 03 '22 19:12 Bogdanp