diff options
author | samgd <sam@samgd.com> | 2016-07-22 16:39:22 +0200 |
---|---|---|
committer | samgd <sam@samgd.com> | 2016-07-22 16:39:22 +0200 |
commit | 02dd1cf2360cb2a650cb61c5e6ae2ca573eb5125 (patch) | |
tree | b218b1df2d619234355787b175c177f8c6fe507e /tests/Hakyll | |
parent | 94cbdc1b1e1965701c7eca147c74d0c19562e1fb (diff) | |
download | hakyll-02dd1cf2360cb2a650cb61c5e6ae2ca573eb5125.tar.gz |
Add Trim_ data constructors. Add If test for Trim
Diffstat (limited to 'tests/Hakyll')
-rw-r--r-- | tests/Hakyll/Web/Template/Tests.hs | 15 |
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-$" ] ] |