fixed up a test (that I hadn't meant to push the last time, sigh)
This commit is contained in:
parent
ca16f25cf1
commit
0e58a37105
|
@ -21,28 +21,42 @@ Of course, other (similar) things can go wrong, too.
|
||||||
|
|
||||||
|#
|
|#
|
||||||
|
|
||||||
(fire-up-drscheme-and-run-tests
|
(define things-to-try
|
||||||
(λ ()
|
(list '(check-expect 1 1)
|
||||||
(putenv "PLTDRHTDPNOCOMPILED" "yes")
|
'(check-within 1 1.01 2)
|
||||||
(define drs-frame (wait-for-drscheme-frame))
|
'(check-error (car))
|
||||||
(set-language-level! '("How to Design Programs" "Beginning Student"))
|
'(check-error (error 'x "y") "x: y")
|
||||||
(clear-definitions drs-frame)
|
'(check-member-of 1 2 3 1 4)
|
||||||
(type-in-definitions drs-frame "(check-expect 1 1)")
|
'(check-range 1 0 2)))
|
||||||
(do-execute drs-frame)
|
|
||||||
(let ([output (fetch-output drs-frame)])
|
(define first-line-output (format "All ~a tests passed!" (length things-to-try)))
|
||||||
(cond
|
|
||||||
[(equal? output "The test passed!")
|
(define (go)
|
||||||
(try-interaction-tests)]
|
(fire-up-drscheme-and-run-tests
|
||||||
[else
|
(λ ()
|
||||||
(fprintf (current-error-port)
|
(putenv "PLTDRHTDPNOCOMPILED" "yes")
|
||||||
"teaching-lang-sharing-modules.rkt: got bad output from execute: ~s"
|
(define drs-frame (wait-for-drscheme-frame))
|
||||||
output)]))))
|
(set-language-level! '("How to Design Programs" "Beginning Student"))
|
||||||
|
(clear-definitions drs-frame)
|
||||||
|
(for ([exp (in-list things-to-try)])
|
||||||
|
(insert-in-definitions drs-frame (format "~s\n" exp)))
|
||||||
|
(do-execute drs-frame)
|
||||||
|
(let ([output (fetch-output drs-frame)])
|
||||||
|
(cond
|
||||||
|
[(equal? output first-line-output)
|
||||||
|
(try-interaction-test drs-frame)]
|
||||||
|
[else
|
||||||
|
(fprintf (current-error-port)
|
||||||
|
"teaching-lang-sharing-modules.rkt: got bad output from execute: ~s"
|
||||||
|
output)])))))
|
||||||
|
|
||||||
(define (try-interaction-test drs-frame)
|
(define (try-interaction-test drs-frame)
|
||||||
(type-in-interactions drs-frame "1\n")
|
(type-in-interactions drs-frame "1\n")
|
||||||
(wait-for-computation drs-frame)
|
(wait-for-computation drs-frame)
|
||||||
(let ([interactions-output (fetch-output drs-frame)])
|
(let ([interactions-output (fetch-output drs-frame)])
|
||||||
(unless (equal? interactions-output "The test passed!\n> 1\n3")
|
(unless (equal? interactions-output (format "~a\n> 1\n1" first-line-output))
|
||||||
(error 'teaching-language-sharing-modules.rkt
|
(error 'teaching-language-sharing-modules.rkt
|
||||||
"got bad output from interaction: ~s\n"
|
"got bad output from interaction: ~s\n"
|
||||||
interactions-output))))
|
interactions-output))))
|
||||||
|
|
||||||
|
(go)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user