added directory for tests expected to fail
This commit is contained in:
parent
f7fd274e80
commit
271f1c19ef
20
collects/2htdp/tests-failed/key-error.rkt
Normal file
20
collects/2htdp/tests-failed/key-error.rkt
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#lang racket
|
||||||
|
|
||||||
|
;; ---------------------------------------------------------------------------------------------------
|
||||||
|
;; the error message should refer to the 'on-tick handler, not the lambda in the clause
|
||||||
|
|
||||||
|
(require 2htdp/universe)
|
||||||
|
(require 2htdp/image)
|
||||||
|
|
||||||
|
(define (main)
|
||||||
|
(big-bang 0
|
||||||
|
(on-tick (lambda (w) "3"))
|
||||||
|
(to-draw (lambda (w) (circle 10 'solid 'red)))
|
||||||
|
(check-with number?)))
|
||||||
|
|
||||||
|
(with-handlers ((exn:fail? (lambda (x)
|
||||||
|
(define msg (exn-message x))
|
||||||
|
(define hdl (regexp-match "check-with: (.*) returned" msg))
|
||||||
|
(unless (and hdl (cons? (regexp-match "on-tick" (second hdl))))
|
||||||
|
(error 'test "expected: \"on-tick\", actual: ~e" (second hdl))))))
|
||||||
|
(main))
|
Loading…
Reference in New Issue
Block a user