rackunit
rackunit copied to clipboard
Running "raco test foo/bar/test.rkt" will cause Racket to change directory to "foo/bar" before invoking "test.rkt", and error messages are printed relative to (current-directory) like raco test: "foo/bar/test.rkt" -------------------- fail FAILURE...
Given the following program on Racket v8.6 [cs]: ``` #lang typed/racket (require rackunit) (for-each (lambda (elt) (with-check-info (('current-element elt)) (check-pred odd? elt))) (list 1 3 5 7 8)) ``` The...
There is a `pretty-info` struct that can be used as the value for a `check-info`, similar to how `string-info` works. This is currently private and undocumented, which makes unit testing...
```racket #lang typed/racket/base (module+ test (require typed/rackunit) (+ 10 20) (+ 30 40) (check-equal? 10)) ``` The error message is ``` hello.rkt:3:0: Type Checker: No function domains matched in function...
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...
In this program: ``` #lang racket (require rackunit) (check-equal? (make-list 20 'xxxx) #f) ``` I see this output: ``` -------------------- . FAILURE name: check-equal? location: 34-unsaved-editor:3:0 actual: '(xxxx xxxx xxxx...
Updated implementation from #114. Resolves racket/racket#2996 Adds: check-compile-time-exn check-not-compile-time-exn Comments and thoughts welcome!
[`require/expose`](https://docs.racket-lang.org/rackunit/api.html#%28form._%28%28lib._rackunit%2Fmain..rkt%29._require%2Fexpose%29%29) can require an unprovided binding from a module. But it only works on functions, not macros. E.g. ```rkt (module aaa racket (define (foo a b) (+ a b)) (define-syntax-rule...
I have a lot of tests that look like this: ```scheme (test-case "customer-order-sales-tax should calculate tax correctly" (define order (customer-order #:price 10.00)) (check-equal? (customer-order-sales-tax order) 0.50)) ``` When this fails,...
It seems that "check" failures inside a nested test suite is not considered a "test" failure: when running the code below, note the `(check = 0 1)`, the failure is...