racket / rackunit

Other
18 stars 32 forks source link

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

Open Bogdanp opened 1 year ago

Bogdanp commented 1 year ago

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