Fixing Rackunit tests after alignment

This commit is contained in:
Jay McCarthy 2012-08-14 22:21:44 -06:00
parent 3ddaf5e32b
commit 4497c8ce5e
4 changed files with 24 additions and 23 deletions

View File

@ -20,5 +20,5 @@
(make-check-actual 1) (make-check-actual 1)
(make-check-expected 2))) (make-check-expected 2)))
(get-output-string p)) (get-output-string p))
"name: \"foo\"\nactual: 1\nexpected: 2\n\n")))) " name: \"foo\"\n actual: 1\n expected: 2\n\n"))))
)) ))

View File

@ -6,17 +6,17 @@
(define output (define output
(with-output-to-string (with-output-to-string
(lambda () (lambda ()
(parameterize ([current-error-port (current-output-port)]) (parameterize ([current-error-port (current-output-port)])
(define-check (check3) (define-check (check3)
(fail-check)) (fail-check))
(run-tests (test-suite "tests" (let ((foo check3)) (foo)))))))) (run-tests (test-suite "tests" (let ((foo check3)) (foo))))))))
(test (test
(regexp-match (regexp-match
(regexp (format "~a.*~a.*~a" (regexp
(regexp-quote "--------------------\ntests > #f\nUnnamed test \nFAILURE\nname: check3\nlocation: ") (format "~a.*~a"
(regexp-quote "pr10950.rkt:14:51") (regexp-quote "--------------------\ntests > #f\nUnnamed test \nFAILURE\n name: check3\n location: pr10950.rkt:14:50\n params: \nCheck failure\n context...:\n")
(regexp-quote "0 success(es) 1 failure(s) 0 error(s) 1 test(s) run\n"))) (regexp-quote "\n--------------------\n0 success(es) 1 failure(s) 0 error(s) 1 test(s) run\n")))
output)) output))

View File

@ -39,10 +39,11 @@ Outta here!
-------------------- --------------------
-------------------- --------------------
FAILURE FAILURE
name: check name: check
location: (#<path:PLTHOME/collects/tests/rackunit/standalone-check-test.rkt> 44 0 1344 17) location: (#<path:PLTHOME/collects/tests/rackunit/standalone-check-test.rkt> 44 0 1344 17)
expression: (check = 1 2) expression: (check = 1 2)
params: (#<procedure:=> 1 2)\nmessage: 0.0 params: (#<procedure:=> 1 2)
message: 0.0
Check failure Check failure
-------------------- --------------------
@ -64,22 +65,22 @@ Second Outta here!
-------------------- --------------------
-------------------- --------------------
FAILURE FAILURE
name: check-eq? name: check-eq?
location: (#<path:PLTHOME/collects/tests/rackunit/standalone-test-case-test.rkt> 19 12 520 15) location: (#<path:PLTHOME/collects/tests/rackunit/standalone-test-case-test.rkt> 19 12 520 15)
expression: (check-eq? 1 2) expression: (check-eq? 1 2)
actual: 1 actual: 1
expected: 2 expected: 2
Check failure Check failure
-------------------- --------------------
-------------------- --------------------
failure failure
FAILURE FAILURE
name: check-eq? name: check-eq?
location: (#<path:PLTHOME/collects/tests/rackunit/standalone-test-case-test.rkt> 20 21 558 15) location: (#<path:PLTHOME/collects/tests/rackunit/standalone-test-case-test.rkt> 20 21 558 15)
expression: (check-eq? 1 2) expression: (check-eq? 1 2)
actual: 1 actual: 1
expected: 2 expected: 2
Check failure Check failure
-------------------- --------------------

View File

@ -139,7 +139,7 @@
(let ((op (with-all-output-to-string (failing-test)))) (let ((op (with-all-output-to-string (failing-test))))
(check string-contains (check string-contains
op op
"location: text-ui-test.rkt")))) "location: text-ui-test.rkt"))))
(test-case (test-case
"Name and location displayed before actual/expected" "Name and location displayed before actual/expected"