commit
643d86c709
|
@ -36,19 +36,20 @@
|
|||
(define-syntax test
|
||||
(syntax-rules ()
|
||||
((test expected expr)
|
||||
(test expected expr equal?))
|
||||
((test expected expr =)
|
||||
(let ((res expr))
|
||||
(display "case ")
|
||||
(write counter)
|
||||
(cond
|
||||
((equal? res expected)
|
||||
(if (= res expected)
|
||||
(begin
|
||||
(display "[0;32m PASS: ")
|
||||
(write 'expr)
|
||||
(display " equals ")
|
||||
(write expected)
|
||||
(display "[0;39m")
|
||||
(newline)
|
||||
)
|
||||
((not (equal? res expected))
|
||||
(newline))
|
||||
(begin
|
||||
(set! failure-counter (+ failure-counter 1))
|
||||
(let ((out (open-output-string)))
|
||||
(display " [0;31mFAIL: " out)
|
||||
|
|
Loading…
Reference in New Issue