You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pollen/pollen/test/test-subtemplate.rkt

15 lines
769 B
Racket

#lang at-exp racket/base
(require rackunit pollen/setup racket/runtime-path pollen/render)
;; define-runtime-path only allowed at top level
(define-runtime-path subtemplate-dir "data/subtemplate")
(define-runtime-path one-source "data/subtemplate/one.txt.pm")
(define-runtime-path two-source "data/subtemplate/subdir/two.txt.pm")
(define-runtime-path three-source "data/subtemplate/subdir/subsubdir/three.txt.pm")
(parameterize ([current-directory subtemplate-dir]
[current-project-root subtemplate-dir]
[current-output-port (open-output-string)])
(check-equal? (render one-source) "one in main template")
(check-equal? (render two-source) "two in main template")
(check-equal? (render three-source) "three in subsubdir template"))