Small adjustment to Matthews change

This commit is contained in:
Jay McCarthy 2010-08-19 16:39:54 -06:00
parent 5eb8f181f6
commit 44b34c37a8
2 changed files with 24 additions and 23 deletions

View File

@ -68,7 +68,9 @@
#t)) #t))
(set! plai-all-test-results (cons result plai-all-test-results)) (set! plai-all-test-results (cons result plai-all-test-results))
(when print? (when print?
(apply printf "(~s ~s ~v ~v ~s)" result) (if (abridged-test-output)
(apply printf "(~s ~v ~v)" result)
(apply printf "(~s ~s ~v ~v ~s)" result))
(newline)) (newline))
(when (and halt-on-errors? error?) (when (and halt-on-errors? error?)
(raise (make-exn:test (string->immutable-string (format "test failed: ~s" result)) (raise (make-exn:test (string->immutable-string (format "test failed: ~s" result))

View File

@ -19,8 +19,8 @@
(->string (test (num 5) (id 'x))) (->string (test (num 5) (id 'x)))
=> =>
(if abridged? (if abridged?
"(bad #(struct:num 5) #(struct:id x))\n" "(bad (num 5) (id 'x))\n"
"(bad (num 5) #(struct:num 5) #(struct:id x) \"at line ??\")\n") "(bad (num 5) (num 5) (id 'x) \"at line ??\")\n")
(->string (test 1 (+ 1 0))) (->string (test 1 (+ 1 0)))
=> =>
@ -48,8 +48,8 @@
=> =>
(if catch? (if catch?
(if abridged? (if abridged?
"(exception \"/: division by zero\" <no-expected-value>)\n" "(exception \"/: division by zero\" '<no-expected-value>)\n"
"(exception (/ 1 0) \"/: division by zero\" <no-expected-value> \"at line ??\")\n") "(exception (/ 1 0) \"/: division by zero\" '<no-expected-value> \"at line ??\")\n")
(error '/ "division by zero")) (error '/ "division by zero"))
(->string (test (error "zamboni") 347)) (->string (test (error "zamboni") 347))
@ -81,36 +81,36 @@
(if errors? (if errors?
"" ""
(if abridged? (if abridged?
"(good 0 zero?)\n" "(good 0 'zero?)\n"
"(good 0 0 zero? \"at line ??\")\n")) "(good 0 0 'zero? \"at line ??\")\n"))
(->string (test/pred 1 zero?)) (->string (test/pred 1 zero?))
=> =>
(if abridged? (if abridged?
"(bad 1 zero?)\n" "(bad 1 'zero?)\n"
"(bad 1 1 zero? \"at line ??\")\n") "(bad 1 1 'zero? \"at line ??\")\n")
(->string (test/pred 1 (error 'pred))) (->string (test/pred 1 (error 'pred)))
=> =>
(if catch? (if catch?
(if abridged? (if abridged?
"(pred-exception \"error: pred\" <no-expected-value>)\n" "(pred-exception \"error: pred\" '<no-expected-value>)\n"
"(pred-exception 1 \"error: pred\" <no-expected-value> \"at line ??\")\n") "(pred-exception 1 \"error: pred\" '<no-expected-value> \"at line ??\")\n")
(error 'pred)) (error 'pred))
(->string (test/pred 1 (lambda (n) (/ 1 0)))) (->string (test/pred 1 (lambda (n) (/ 1 0))))
=> =>
(if catch? (if catch?
(if abridged? (if abridged?
"(pred-exception \"/: division by zero\" <no-expected-value>)\n" "(pred-exception \"/: division by zero\" '<no-expected-value>)\n"
"(pred-exception 1 \"/: division by zero\" <no-expected-value> \"at line ??\")\n") "(pred-exception 1 \"/: division by zero\" '<no-expected-value> \"at line ??\")\n")
(error '/ "division by zero")) (error '/ "division by zero"))
(->string (test/pred "a" string->number)) (->string (test/pred "a" string->number))
=> =>
(if abridged? (if abridged?
"(bad \"a\" string->number)\n" "(bad \"a\" 'string->number)\n"
"(bad \"a\" \"a\" string->number \"at line ??\")\n") "(bad \"a\" \"a\" 'string->number \"at line ??\")\n")
(->string (test/exn (error "zamboni") "zamboni")) (->string (test/exn (error "zamboni") "zamboni"))
=> =>
@ -140,8 +140,8 @@
=> =>
(if catch? (if catch?
(if abridged? (if abridged?
"(exception \"/: division by zero\" <no-expected-value>)\n" "(exception \"/: division by zero\" '<no-expected-value>)\n"
"(exception (/ 1 0) \"/: division by zero\" <no-expected-value> \"at line ??\")\n") "(exception (/ 1 0) \"/: division by zero\" '<no-expected-value> \"at line ??\")\n")
(error '/ "division by zero")) (error '/ "division by zero"))
(->string (test/regexp (error "zamboni") "zam")) (->string (test/regexp (error "zamboni") "zam"))
@ -169,12 +169,11 @@
"(bad 5 5 \"zam\" \"at line ??\")\n") "(bad 5 5 \"zam\" \"at line ??\")\n")
(->string (test/regexp (/ 1 0) "divis")) (->string (test/regexp (/ 1 0) "divis"))
=> =>(if catch?
(if catch? (if abridged?
(if abridged? "(exception \"/: division by zero\" '<no-expected-value>)\n"
"(exception \"/: division by zero\" <no-expected-value>)\n" "(exception (/ 1 0) \"/: division by zero\" '<no-expected-value> \"at line ??\")\n")
"(exception (/ 1 0) \"/: division by zero\" <no-expected-value> \"at line ??\")\n") (error '/ "division by zero"))
(error '/ "division by zero"))
))) )))