From 02dd1cf2360cb2a650cb61c5e6ae2ca573eb5125 Mon Sep 17 00:00:00 2001 From: samgd Date: Fri, 22 Jul 2016 16:39:22 +0200 Subject: Add Trim_ data constructors. Add If test for Trim --- tests/Hakyll/Web/Template/Tests.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') 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-$" ] ] -- cgit v1.2.3