|
|
@ -1,5 +1,5 @@
|
|
|
|
#lang at-exp racket/base
|
|
|
|
#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 only allowed at top level
|
|
|
|
(define-runtime-path poly-output-path-dir "data/poly-output-path")
|
|
|
|
(define-runtime-path poly-output-path-dir "data/poly-output-path")
|
|
|
@ -14,16 +14,17 @@
|
|
|
|
[current-project-root poly-output-path-dir])
|
|
|
|
[current-project-root poly-output-path-dir])
|
|
|
|
|
|
|
|
|
|
|
|
(for ([parallel? (list #true #false)])
|
|
|
|
(for ([parallel? (list #true #false)])
|
|
|
|
;; passing "text.txt" as argument should force use of `txt` rendering
|
|
|
|
;; passing "text.txt" as argument should force use of `txt` rendering
|
|
|
|
(render-batch #:parallel parallel? test.txt)
|
|
|
|
(render-batch #:parallel parallel? test.txt)
|
|
|
|
(check-equal? (file->string test.txt) "(root hello world)")
|
|
|
|
(check-equal? (file->string test.txt) "(root hello world)")
|
|
|
|
(delete-file test.txt)
|
|
|
|
(delete-file test.txt)
|
|
|
|
(check-false (file-exists? test.html))
|
|
|
|
(check-false (file-exists? test.html))
|
|
|
|
|
|
|
|
;; passing poly source as argument should result in default (html) rendering
|
|
|
|
;; passing poly source as argument should result in default (html) rendering
|
|
|
|
(render-batch #:parallel parallel? test.poly.pm)
|
|
|
|
(render-batch #:parallel parallel? test.poly.pm)
|
|
|
|
(check-txexprs-equal?
|
|
|
|
(check-equal? (file->string test.html) "<html><head><meta charset=\"UTF-8\"/></head><body><root>hello world</root></body></html>")
|
|
|
|
(string->xexpr (file->string test.html))
|
|
|
|
(delete-file test.html)
|
|
|
|
(string->xexpr "<html><head><meta charset=\"UTF-8\"/></head><body><root>hello world</root></body></html>"))
|
|
|
|
(check-false (file-exists? test.txt))))
|
|
|
|
(delete-file test.html)
|
|
|
|
|
|
|
|
(check-false (file-exists? test.txt))))
|
|
|
|
|
|
|
|
|
|
|
|
(delete-directory/files pollen-cache)
|
|
|
|
(delete-directory/files pollen-cache)
|