Add a test file to check the hack that errortrace uses.
(Makes it easy to know when it breaks, and hopefully to fix it when that happens)
This commit is contained in:
parent
767d72ed03
commit
8709715bf4
|
@ -1409,6 +1409,7 @@ path/s is either such a string or a list of them.
|
|||
"collects/tests/drracket/teaching-lang-save-file.rkt" drdr:command-line (gracket *)
|
||||
"collects/tests/drracket/teachpack.rkt" drdr:command-line (gracket *)
|
||||
"collects/tests/drracket/time-keystrokes.rkt" drdr:command-line (gracket-text "-t" *)
|
||||
"collects/tests/errortrace/alert.rkt" responsible (eli)
|
||||
"collects/tests/framework" responsible (robby)
|
||||
"collects/tests/framework/canvas.rkt" drdr:command-line (mzc "-k" *)
|
||||
"collects/tests/framework/debug.rkt" drdr:command-line (mzc "-k" *)
|
||||
|
|
22
collects/tests/errortrace/alert.rkt
Normal file
22
collects/tests/errortrace/alert.rkt
Normal file
|
@ -0,0 +1,22 @@
|
|||
#lang racket/base
|
||||
|
||||
(require tests/eli-tester (for-syntax racket/base))
|
||||
|
||||
;; All current uses of the errortrace collection (there are currently 4:
|
||||
;; in the sandbox, drracket, and in htdp and deinprogramm) rely on
|
||||
;; making "self-modifying" code by using a single mpair in source code.
|
||||
;; This is a fragile hole, and it might be plugged at some point in the
|
||||
;; future. (Another alternative is to inject a closure as a value into
|
||||
;; the syntax, which is similarly hackish.) The purpose of this test is
|
||||
;; to fail when that happens, so we remember to deal with it in these
|
||||
;; uses. A convenient commit to refer to is 2189957 -- it touches all
|
||||
;; four places. (BTW, note that this file cannot be compiled because of
|
||||
;; this.)
|
||||
|
||||
(define-syntax m
|
||||
(let ([b (mcons 0 0)])
|
||||
(lambda (stx)
|
||||
(with-syntax ([b b])
|
||||
#'(lambda () (set-mcar! b (add1 (mcar b))) (mcar b))))))
|
||||
(let ([f m])
|
||||
(test (list (f) (f) (f)) => '(1 2 3)))
|
|
@ -8,6 +8,7 @@
|
|||
'("2htdp"
|
||||
"aligned-pasteboard"
|
||||
"deinprogramm"
|
||||
"errortrace"
|
||||
"future"
|
||||
"gracket"
|
||||
"honu"
|
||||
|
@ -19,7 +20,6 @@
|
|||
"plai"
|
||||
"planet"
|
||||
"plot"
|
||||
"profj"
|
||||
"r6rs"
|
||||
"rackunit"
|
||||
"srfi"
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
(test "net/main.rkt")
|
||||
(test "file/main.rkt")
|
||||
(test "profile/main.rkt")
|
||||
(test "errortrace/alert.rkt")
|
||||
)
|
||||
|
||||
(require racket/runtime-path)
|
||||
|
|
Loading…
Reference in New Issue
Block a user