summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Web/Template
diff options
context:
space:
mode:
authorsamgd <sam@samgd.com>2016-07-22 16:39:22 +0200
committersamgd <sam@samgd.com>2016-07-22 16:39:22 +0200
commit02dd1cf2360cb2a650cb61c5e6ae2ca573eb5125 (patch)
treeb218b1df2d619234355787b175c177f8c6fe507e /tests/Hakyll/Web/Template
parent94cbdc1b1e1965701c7eca147c74d0c19562e1fb (diff)
downloadhakyll-02dd1cf2360cb2a650cb61c5e6ae2ca573eb5125.tar.gz
Add Trim_ data constructors. Add If test for Trim
Diffstat (limited to 'tests/Hakyll/Web/Template')
-rw-r--r--tests/Hakyll/Web/Template/Tests.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Hakyll/Web/Template/Tests.hs b/tests/Hakyll/Web/Template/Tests.hs
index 7d5d6ec..453cd49 100644
--- a/tests/Hakyll/Web/Template/Tests.hs
+++ b/tests/Hakyll/Web/Template/Tests.hs
@@ -39,6 +39,21 @@ tests = testGroup "Hakyll.Core.Template.Tests" $ concat
(Template [Chunk "foo"])
Nothing]
@=? readTemplate "$if(a(\"bar\"))$foo$endif$"
+ -- 'If' 'Trim_' test.
+ , Template
+ [ TrimL
+ , If (Ident (TemplateKey "body"))
+ (Template [ TrimR
+ , Expr (Ident (TemplateKey "body"))
+ ])
+ (Just (Template [ TrimL
+ , TrimR
+ , Expr (Ident (TemplateKey "body"))
+ ]))
+ , TrimL
+ , TrimR
+ ]
+ @=? readTemplate "$-if(body)-$\n$body$\n$-else-$\n$body$\n$-endif-$"
]
]