summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2014-10-27 13:19:56 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2014-10-27 13:19:56 +0100
commit24e0c1a91858832ad8d37feaabf3b30dc1027230 (patch)
treede5b3fac75352177a055d1f0e33dbb7037b3c12c
parent59b6f01218eb2fbd36cb9fec6a3413093171ccda (diff)
downloadhakyll-24e0c1a91858832ad8d37feaabf3b30dc1027230.tar.gz
Add tests
-rw-r--r--tests/Hakyll/Web/Template/Tests.hs17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/Hakyll/Web/Template/Tests.hs b/tests/Hakyll/Web/Template/Tests.hs
index 8baf01b..9f8ab14 100644
--- a/tests/Hakyll/Web/Template/Tests.hs
+++ b/tests/Hakyll/Web/Template/Tests.hs
@@ -26,9 +26,20 @@ import TestSuite.Util
--------------------------------------------------------------------------------
tests :: Test
-tests = testGroup "Hakyll.Core.Template.Tests"
- [ testCase "case01" case01
- , testCase "applyJoinTemplateList" testApplyJoinTemplateList
+tests = testGroup "Hakyll.Core.Template.Tests" $ concat
+ [ [ testCase "case01" case01
+ , testCase "applyJoinTemplateList" testApplyJoinTemplateList
+ ]
+
+ , fromAssertions "readTemplate"
+ [ Template [Chunk "Hello ", Expr (Call "guest" [])]
+ @=? readTemplate "Hello $guest()$"
+ , Template
+ [If (Call "a" [StringLiteral "bar"])
+ (Template [Chunk "foo"])
+ Nothing]
+ @=? readTemplate "$if(a(\"bar\"))$foo$endif$"
+ ]
]