more flexible test

dev-poly-fix-201114
Matthew Butterick 4 years ago
parent 8a8e497bfe
commit e434406b46

@ -1 +1 @@
1603075171
1603077405

@ -1,5 +1,5 @@
#lang at-exp racket/base
(require rackunit racket/runtime-path pollen/render racket/file racket/system pollen/setup)
(require rackunit racket/runtime-path pollen/render racket/file racket/system pollen/setup txexpr xml)
;; define-runtime-path only allowed at top level
(define-runtime-path poly-output-path-dir "data/poly-output-path")
@ -19,10 +19,11 @@
(check-equal? (file->string test.txt) "(root hello world)")
(delete-file test.txt)
(check-false (file-exists? test.html))
;; passing poly source as argument should result in default (html) rendering
(render-batch #:parallel parallel? test.poly.pm)
(check-equal? (file->string test.html) "<html><head><meta charset=\"UTF-8\"/></head><body><root>hello world</root></body></html>")
(check-txexprs-equal?
(string->xexpr (file->string test.html))
(string->xexpr "<html><head><meta charset=\"UTF-8\"/></head><body><root>hello world</root></body></html>"))
(delete-file test.html)
(check-false (file-exists? test.txt))))

Loading…
Cancel
Save