15 lines
441 B
Scheme
15 lines
441 B
Scheme
(define-module (tests utils)
|
|
#:use-module (srfi srfi-64)
|
|
#:export (verify-output))
|
|
|
|
(define (verify-output-fn expected proc)
|
|
"Ensures that the output sequence is what is expected"
|
|
(test-equal
|
|
expected
|
|
(call-with-output-string
|
|
(λ (port)
|
|
(parameterize ((current-output-port port))
|
|
(proc))))))
|
|
|
|
(define-syntax-rule (verify-output expected body ...)
|
|
(verify-output-fn expected (lambda () body ...)))
|