summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Web
diff options
context:
space:
mode:
authorsamgd <sam@samgd.com>2016-07-23 12:41:41 +0200
committersamgd <sam@samgd.com>2016-07-23 12:41:41 +0200
commit6e14d33a101e4ea9559d13d7a562da7ebc72acf2 (patch)
treee8cfc4c4f853ab1c6295e06430a5e64e53bc623d /tests/Hakyll/Web
parent6c0be2e2d3b8992263573540b3498ea51b10b2e6 (diff)
downloadhakyll-6e14d33a101e4ea9559d13d7a562da7ebc72acf2.tar.gz
For trimming
Diffstat (limited to 'tests/Hakyll/Web')
-rw-r--r--tests/Hakyll/Web/Template/Tests.hs16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/Hakyll/Web/Template/Tests.hs b/tests/Hakyll/Web/Template/Tests.hs
index c1991a0..b6a3a1d 100644
--- a/tests/Hakyll/Web/Template/Tests.hs
+++ b/tests/Hakyll/Web/Template/Tests.hs
@@ -6,7 +6,6 @@ module Hakyll.Web.Template.Tests
--------------------------------------------------------------------------------
-import Data.Monoid (mconcat)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit (Assertion, (@=?), (@?=))
@@ -33,12 +32,12 @@ tests = testGroup "Hakyll.Core.Template.Tests" $ concat
, fromAssertions "readTemplate"
[ Template [Chunk "Hello ", Expr (Call "guest" [])]
- @=? readTemplate "Hello $guest()$"
+ @=? readTemplate "Hello $guest()$"
, Template
[If (Call "a" [StringLiteral "bar"])
(Template [Chunk "foo"])
Nothing]
- @=? readTemplate "$if(a(\"bar\"))$foo$endif$"
+ @=? readTemplate "$if(a(\"bar\"))$foo$endif$"
-- 'If' trim check.
, Template
[ TrimL
@@ -58,6 +57,17 @@ tests = testGroup "Hakyll.Core.Template.Tests" $ concat
, TrimR
]
@=? readTemplate "$-if(body)-$\n$body$\n$-else-$\n$body$\n$-endif-$"
+ -- 'For' trim check.
+ , Template
+ [ TrimL
+ , TrimR
+ , For (Ident (TemplateKey "authors"))
+ (Template [Chunk "\n body \n"])
+ Nothing
+ , TrimL
+ , TrimR
+ ]
+ @=? readTemplate "$-for(authors)-$\n body \n$-endfor-$"
]
]