File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
htdp-test/tests/test-engine Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 4545 (check-pred null? failed-checks))
4646 (initialize-test-object!))
4747
48- (define (check-failure reason? . selector+value-list)
48+
49+ (define-syntax-rule (check-failure reason . selector+value-list)
50+ (check-failure* #'reason reason . selector+value-list))
51+
52+ (define (check-failure* src reason? . selector+value-list)
4953 (let* ((test-object (run-tests!))
5054 (failed-checks (test-object-failed-checks test-object)))
5155 (check-equal? (length failed-checks) 1 )
5458 (for/fold ([l (object-name reason?)])
5559 ([f selector+value-list] [i (in-naturals)] #:when (even? i))
5660 (~a l ", " (object-name f))))
57- (error 'check-failure "expected failed check, none failed (~a) " names))
61+ (error 'check-failure "expected failed check, none failed (~a) (~a) " names src ))
5862 (apply assert-failed-check (car failed-checks) reason? selector+value-list))
5963 (initialize-test-object!))
6064
376380 (list x1 x2 x3 x4)))
377381(check-failure unequal?)
378382
379- (define (h _x) (car ( list (random 50 ) (random 20 ) (random 100 ) (random 70 ) )))
383+ (define (h _x) (list (random 50 ) (random 20 ) (random 100 ) (random 70 )))
380384
381- (check-random (h 0 ) (begin0 (random 50 ) (random 20 ) (random 100 ) (random 70 )))
385+ (check-random (h 0 ) (list (random 50 ) (random 20 ) (random 100 ) (random 70 )))
382386(check-success)
383387
384- (check-random (h 0 ) (begin (random 20 ) (random 50 ) (random 70 ) (random 100 ))) ;; fails
388+ (check-random (h 0 ) (list (random 20 ) (random 50 ) (random 70 ) (random 100 )))
385389(check-failure unequal?)
386390
387391(check-property
You can’t perform that action at this time.
0 commit comments