@@ -6,7 +6,6 @@ module Hakyll.Web.Template.Tests
66
77
88--------------------------------------------------------------------------------
9−import Data.Monoid (mconcat)
109import Test.Framework (Test, testGroup)
1110import Test.Framework.Providers.HUnit (testCase)
1211import Test.HUnit (Assertion, (@=?), (@?=))
@@ -33,12 +32,12 @@ tests = testGroup "Hakyll.Core.Template.Tests" $ concat
3332
3433 , fromAssertions "readTemplate"
3534 [ Template [Chunk "Hello ", Expr (Call "guest" [])]
36− @=? readTemplate "Hello $guest()$"
35+ @=? readTemplate "Hello $guest()$"
3736 , Template
3837 [If (Call "a" [StringLiteral "bar"])
3938 (Template [Chunk "foo"])
4039 Nothing]
41− @=? readTemplate "$if(a(\"bar\"))$foo$endif$"
40+ @=? readTemplate "$if(a(\"bar\"))$foo$endif$"
4241 -- 'If' trim check.
4342 , Template
4443 [ TrimL
@@ -58,6 +57,17 @@ tests = testGroup "Hakyll.Core.Template.Tests" $ concat
5857 , TrimR
5958 ]
6059 @=? readTemplate "$-if(body)-$\n$body$\n$-else-$\n$body$\n$-endif-$"
60+ -- 'For' trim check.
61+ , Template
62+ [ TrimL
63+ , TrimR
64+ , For (Ident (TemplateKey "authors"))
65+ (Template [Chunk "\n body \n"])
66+ Nothing
67+ , TrimL
68+ , TrimR
69+ ]
70+ @=? readTemplate "$-for(authors)-$\n body \n$-endfor-$"
6171 ]
6272 ]
6373