File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
rackunit-lib/rackunit/private
rackunit-test/tests/rackunit Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 104104 (with-default-check-info* infos
105105 (λ () ((current-check-around) (λ () body ... (void))))))
106106 'pub )))
107+
107108
108109(define-simple-macro (define-check (name:id formal:id ... ) body:expr ... )
109110 (begin
112113 (with-syntax ([loc (datum->syntax #f 'loc stx)])
113114 (syntax-parse stx
114115 [(chk . args)
115- #'((check-impl #:location (syntax->location #'loc )
116- #:expression '(chk . args))
117- . args)]
116+ #'(let ([location (syntax->location #'loc )])
117+ (with-default-check-info*
118+ (list (make-check-name 'name )
119+ (make-check-location location)
120+ (make-check-expression '(chk . args)))
121+ (λ ()
122+ ((current-check-around)
123+ (λ () ((check-impl #:location location
124+ #:expression '(chk . args))
125+ . args))))))]
118126 [chk:id
119127 #'(check-impl #:location (syntax->location #'loc )
120128 #:expression 'chk )])))))
Original file line number Diff line number Diff line change 121121 (display-raised-message e)]
122122 [else
123123 (display-raised-summary "ERROR " e)
124+ (display-check-info-stack (current-check-info)
125+ #:verbose? verbose?)
124126 (display-raised-message e)])
125127 (display-delimiter)))
126128
Original file line number Diff line number Diff line change 4141 #"\
4242--------------------
4343ERROR
44+ name: check-pred
45+ location: standalone-check-test.rkt:44:0
4446
4547Outta here!
4648--------------------
@@ -59,12 +61,14 @@ message: 0.0
5961--------------------
6062ERROR
6163
64+
6265First Outta here!
6366--------------------
6467--------------------
6568error
6669ERROR
6770
71+
6872Second Outta here!
6973--------------------
7074--------------------
You can’t perform that action at this time.
0 commit comments