adjust plai test suite tests to check the ports that things now go to

This commit is contained in:
Robby Findler 2013-02-28 07:03:40 -06:00
parent ca304aafaf
commit 8a08cfcbbf

View File

@ -1,5 +1,6 @@
#lang plai #lang plai
(require (prefix-in eli: tests/eli-tester)) (require (prefix-in eli: tests/eli-tester)
"util.rkt")
(define-type WAE (define-type WAE
[binop (p procedure?) (lhs WAE?) (rhs WAE?)] [binop (p procedure?) (lhs WAE?) (rhs WAE?)]
@ -7,7 +8,11 @@
[id (s symbol?)]) [id (s symbol?)])
(define-syntax-rule (->string e) (define-syntax-rule (->string e)
(regexp-replace "line [0-9]+" (with-both-output-to-string (λ () e)) "line ??"))
(define-syntax-rule (->err-string e)
(regexp-replace "line [0-9]+" (with-err-output-to-string (λ () e)) "line ??")) (regexp-replace "line [0-9]+" (with-err-output-to-string (λ () e)) "line ??"))
(define-syntax-rule (->out-string e)
(regexp-replace "line [0-9]+" (with-output-to-string (λ () e)) "line ??"))
(define (with-err-output-to-string thunk) (define (with-err-output-to-string thunk)
(define sp (open-output-string)) (define sp (open-output-string))
@ -51,12 +56,26 @@
"(good 1 1)\n" "(good 1 1)\n"
"(good 1 1 1 \"at line ??\")\n")) "(good 1 1 1 \"at line ??\")\n"))
(->out-string (test 1 1))
=>
(if errors?
""
(if abridged?
"(good 1 1)\n"
"(good 1 1 1 \"at line ??\")\n"))
(->string (test 1 2)) (->string (test 1 2))
=> =>
(if abridged? (if abridged?
"(bad 1 2)\n" "(bad 1 2)\n"
"(bad 1 1 2 \"at line ??\")\n") "(bad 1 1 2 \"at line ??\")\n")
(->err-string (test 1 2))
=>
(if abridged?
"(bad 1 2)\n"
"(bad 1 1 2 \"at line ??\")\n")
(->string (test (/ 1 0) 0)) (->string (test (/ 1 0) 0))
=> =>
(if catch? (if catch?