diff --git a/collects/tests/rackunit/standalone.rkt b/collects/tests/rackunit/standalone.rkt index 00f00f6769..5c096a2266 100644 --- a/collects/tests/rackunit/standalone.rkt +++ b/collects/tests/rackunit/standalone.rkt @@ -8,12 +8,14 @@ (normalize-path (build-path here ".." ".."))) (define (collect-trim bs) (regexp-replace* (regexp-quote (path->bytes collects)) bs #"PLTHOME/collects")) - + (define (require&catch path) (define out-bs (open-output-bytes)) (define err-bs (open-output-bytes)) (parameterize ([current-output-port out-bs] - [current-error-port err-bs]) + [current-error-port err-bs] + ;; Don't test context output; it's too fragile. + [error-print-context-length 0]) (dynamic-require path #f)) (close-output-port out-bs) (close-output-port err-bs) @@ -29,9 +31,56 @@ (test-file "standalone-check-test.rkt" #"Oh HAI!\nI didn't run\n" - #"--------------------\nERROR\nOutta here!\n\n === context ===\nPLTHOME/collects/tests/rackunit/standalone-check-test.rkt:40:12: temp7\nPLTHOME/collects/rackunit/private/check.rkt:122:29\nPLTHOME/collects/racket/private/more-scheme.rkt:209:2: call-handled-body\nPLTHOME/collects/rackunit/private/check.rkt:55:0: top-level-check-around\nPLTHOME/collects/rackunit/private/check.rkt:108:21: core50\n\n\n--------------------\n--------------------\nFAILURE\nname: check\nlocation: (# 44 0 1344 17)\nexpression: (check = 1 2)\nparams: (# 1 2)\nmessage: 0.0\n\nCheck failure\n--------------------\n") + #"\ +-------------------- +ERROR +Outta here! + +-------------------- +-------------------- +FAILURE +name: check +location: (# 44 0 1344 17) +expression: (check = 1 2) +params: (# 1 2)\nmessage: 0.0 + +Check failure +-------------------- +") (test-file "standalone-test-case-test.rkt" #"" - #"--------------------\nERROR\nFirst Outta here!\n\n === context ===\nPLTHOME/collects/racket/private/more-scheme.rkt:209:2: call-handled-body\n\n\n--------------------\n--------------------\nerror\nERROR\nSecond Outta here!\n\n === context ===\nPLTHOME/collects/racket/private/more-scheme.rkt:209:2: call-handled-body\n\n\n--------------------\n--------------------\nFAILURE\nname: check-eq?\nlocation: (# 19 12 520 15)\nexpression: (check-eq? 1 2)\nactual: 1\nexpected: 2\n\nCheck failure\n--------------------\n--------------------\nfailure\nFAILURE\nname: check-eq?\nlocation: (# 20 21 558 15)\nexpression: (check-eq? 1 2)\nactual: 1\nexpected: 2\n\nCheck failure\n--------------------\n") + #"\ +-------------------- +ERROR +First Outta here! +-------------------- +-------------------- +error +ERROR +Second Outta here! + +-------------------- +-------------------- +FAILURE +name: check-eq? +location: (# 19 12 520 15) +expression: (check-eq? 1 2) +actual: 1 +expected: 2 + +Check failure +-------------------- +-------------------- +failure +FAILURE +name: check-eq? +location: (# 20 21 558 15) +expression: (check-eq? 1 2) +actual: 1 +expected: 2 + +Check failure +-------------------- +")