fixed incorrect change of appendbang to append, added test/exn

svn: r12041
This commit is contained in:
John Clements 2008-10-15 07:35:45 +00:00
parent 6266b12d6d
commit 44ff646c50

View File

@ -320,7 +320,9 @@
(provide add-header-line!)
(define (add-header-line! line)
(let ([new (list line)] [cur (thread-cell-ref added-lines)])
(if cur (append cur new) (thread-cell-set! added-lines new))))
(if cur
(set-box! cur (append (unbox cur) new))
(thread-cell-set! added-lines (box new)))))
(define ((wrap-evaluator eval) expr)
(define unknown "unknown")
@ -477,7 +479,7 @@
(prefix-line (user-substs user student-line)))
(for-each prefix-line/substs extra-lines)
(for-each prefix-line/substs
(or (thread-cell-ref added-lines) '()))
(unbox (or (thread-cell-ref added-lines) (box '()))))
(display submission-text))))
(define submission-text
(and create-text?
@ -697,6 +699,15 @@
(error* "your code failed a test: ~e evaluated to ~e, expecting ~e"
(->disp 'expr) (->disp val) (->disp result))))]))
(provide !test/exn)
(define-syntax (!test/exn stx)
(syntax-case stx ()
[(_ test-exp)
#`(with-handlers ([exn:fail? (lambda (exn) #t)])
((submission-eval) `test-exp)
(error* "expected exception on test expression: ~v"
(->disp 'test-exp)))]))
(provide !all-covered)
(define coverage-checked (make-thread-cell #f))
(define (!all-covered . proc)