From 8a08cfcbbf73db5e0e3a7b381b5f3c6567760108 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 28 Feb 2013 07:03:40 -0600 Subject: [PATCH] adjust plai test suite tests to check the ports that things now go to --- collects/tests/plai/test-harness.rkt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/collects/tests/plai/test-harness.rkt b/collects/tests/plai/test-harness.rkt index 49ba469043..ba7633f86b 100644 --- a/collects/tests/plai/test-harness.rkt +++ b/collects/tests/plai/test-harness.rkt @@ -1,5 +1,6 @@ #lang plai -(require (prefix-in eli: tests/eli-tester)) +(require (prefix-in eli: tests/eli-tester) + "util.rkt") (define-type WAE [binop (p procedure?) (lhs WAE?) (rhs WAE?)] @@ -7,7 +8,11 @@ [id (s symbol?)]) (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 ??")) +(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 sp (open-output-string)) @@ -51,12 +56,26 @@ "(good 1 1)\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)) => (if abridged? "(bad 1 2)\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)) => (if catch?