added directory for tests expected to fail

This commit is contained in:
Matthias Felleisen 2011-08-05 12:08:43 -04:00
parent f7fd274e80
commit 271f1c19ef

View 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))