(import colorize test (chicken pathname)) (test-begin "colorizer") (find-files "." test: ".*\\.in" action: (lambda (fn _) (let* ((in (with-input-from-file fn (cut read-string #f))) (expfile (pathname-replace-extension fn "expected")) (expected (with-input-from-file expfile (cut read-string #f))) (type (pathname-extension (pathname-strip-extension fn))) (out (html-colorize (string->symbol type) in))) ;; Useful for debugging; the output is large and mostly garbage ;; unless re-formatted properly (with-output-to-file (pathname-replace-extension fn "out") (lambda () (display out))) (test (pathname-file fn) expected out)))) (test-end "colorizer") (test-exit)