diff options
| author | 2021-10-23 00:09:48 -0500 | |
|---|---|---|
| committer | 2021-10-23 00:09:48 -0500 | |
| commit | b491eeb963d89d35b06e7728f98bc269d5e50551 (patch) | |
| tree | d6747ff184e2fa3efe31efeb67256b2657f305fe /test | |
| parent | Merge pull request #50 from elimisteve/patch-1 (diff) | |
| parent | Add discrete test for each of the chunk type (diff) | |
Merge pull request #49 from pepe/discrete-test
Add discrete test for each of the chunk type
Diffstat (limited to 'test')
| -rw-r--r-- | test/suite0008.janet | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/suite0008.janet b/test/suite0008.janet index 2cdb843..edcb1ee 100644 --- a/test/suite0008.janet +++ b/test/suite0008.janet @@ -39,4 +39,23 @@ (def expected "<html>hello world</html>") (test/assert (= expected (string out)) "Rendered temple string produces \"hello world\"") +(def ctc + `{$ (import /spork/fmt) $}{{ (fmt/format (string "(def c " (args :a) " )")) }}`) + +(test/assert (deep= ((temple/compile ctc) :a "a > b") + @"(def c a > b)\n") + "compile time chunk") + +(test/assert (deep= ((temple/compile `{{ (args :a) }}`) :a "a > b") + @"a > b") + "sub chunk") + +(test/assert (deep= ((temple/compile `{% (print (args :a)) %}`) :a "a > b") + @"a > b\n") + "code chunk") + +(test/assert (deep= ((temple/compile `{- (args :a) -}`) :a "a > b") + @"a > b") + "raw chunk") + (test/end-suite) |
