The check-equal? function and friends don't do anything special to delimit control, so failing a check will abort the whole program if it isn't contained within a test case. You can use the test-case or test-begin forms to limit the extent of fail-check (which just raises an exn:test:check exception).
(test-begin (check-equal? (f x) 4)) Alternatively, you might want to take a look at define-simple-check, define-binary-check, and define-check, which allow that sort of control without explicitly wrapping checks in test cases. > On Mar 30, 2015, at 13:52, 'John Clements' via users-redirect > <us...@plt-scheme.org> wrote: > > I’m writing a test suite, and I’d like a way to abort a test without aborting > a test suite. It looks to me like “fail-check” is supposed to do this. > Here’s the code I wrote: > > #lang racket > > (require rackunit) > > (define (f x) > (fail-check "foo") > (/ 1 0)) > > (check-equal? (f 3) 4) > (check-equal? 9 13) > > I would like for the first test to fail with error message “foo”, and the > second one to fail normally. > > However, the ‘fail-check’ aborts the test and all remaining tests. Is this > the expected behavior? > > John > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.