Skip to content

Commit

Permalink
Refactor - Use cond for further extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
kana committed Nov 10, 2011
1 parent d239376 commit cb81a85
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions test/gasmine.scm
Expand Up @@ -207,32 +207,34 @@
(if (is-a? maybe-error <evaluation-failure>)
(ref maybe-error 'original-error)
maybe-error))
(if (get :todo more-info)
(format #t
"~a ~a - # TODO ~a~a\n"
"not ok"
test-count
description
(let1 message (get :message more-info)
(if (undefined? message)
""
(format " (~a)" message))))
(format #t
(string-join
'("~a ~a - ~a"
"# Expected ~s ~a ~s"
"# Actual value: ~s"
"# Expected value: ~s")
"\n"
'suffix)
"not ok"
test-count
description
(get :actual-value-form more-info)
(get :matcher-name more-info)
(get :expected-value-form more-info)
(format-maybe-error (get :actual-value more-info))
(format-maybe-error (get :expected-value more-info)))))
(cond
[(get :todo more-info)
(format #t
"~a ~a - # TODO ~a~a\n"
"not ok"
test-count
description
(let1 message (get :message more-info)
(if (undefined? message)
""
(format " (~a)" message))))]
[else
(format #t
(string-join
'("~a ~a - ~a"
"# Expected ~s ~a ~s"
"# Actual value: ~s"
"# Expected value: ~s")
"\n"
'suffix)
"not ok"
test-count
description
(get :actual-value-form more-info)
(get :matcher-name more-info)
(get :expected-value-form more-info)
(format-maybe-error (get :actual-value more-info))
(format-maybe-error (get :expected-value more-info)))]))
(define (run-spec-procedure spec)
(define (run-blocks suite type)
(for-each
Expand Down

0 comments on commit cb81a85

Please sign in to comment.