guile-reflow/tests/utils.scm

16 lines
441 B
Scheme
Raw Normal View History

2024-02-29 14:54:46 +00:00
(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 ...)))