diff options
| author | 2021-10-18 13:52:01 +0200 | |
|---|---|---|
| committer | 2021-10-18 13:52:01 +0200 | |
| commit | a421e531e217b5b9e2b8d94958756e38ba0ddd5e (patch) | |
| tree | dbe0b46fb07e6abb99b62216ccbfd821af26f81f /test | |
| parent | Merge pull request #45 from pepe/fix-reading-req (diff) | |
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) |
