From 59b6f01218eb2fbd36cb9fec6a3413093171ccda Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 27 Oct 2014 12:20:31 +0100 Subject: Better functions in templates --- tests/Hakyll/Web/Template/Context/Tests.hs | 2 +- tests/Hakyll/Web/Template/Tests.hs | 2 +- tests/data/template.html | 3 ++- tests/data/template.html.out | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/Hakyll/Web/Template/Context/Tests.hs b/tests/Hakyll/Web/Template/Context/Tests.hs index 627624f..5f77dad 100644 --- a/tests/Hakyll/Web/Template/Context/Tests.hs +++ b/tests/Hakyll/Web/Template/Context/Tests.hs @@ -51,7 +51,7 @@ testContextDone :: Store -> Provider -> Identifier -> String testContextDone store provider identifier key context = testCompilerDone store provider identifier $ do item <- getResourceBody - cf <- unContext context key item + cf <- unContext context key [] item case cf of StringField str -> return str ListField _ _ -> error $ diff --git a/tests/Hakyll/Web/Template/Tests.hs b/tests/Hakyll/Web/Template/Tests.hs index 8763147..8baf01b 100644 --- a/tests/Hakyll/Web/Template/Tests.hs +++ b/tests/Hakyll/Web/Template/Tests.hs @@ -76,4 +76,4 @@ testApplyJoinTemplateList = do where i1 = Item "item1" "Hello" i2 = Item "item2" "World" - tpl = Template [Chunk "", Key "body", Chunk ""] + tpl = Template [Chunk "", Expr (Ident "body"), Chunk ""] diff --git a/tests/data/template.html b/tests/data/template.html index 26f9e8a..55e76f6 100644 --- a/tests/data/template.html +++ b/tests/data/template.html @@ -1,7 +1,8 @@
I'm so rich I have $$3. - $rev foo$ + $rev("foo")$ + $rev(rev("foo"))$ $if(body)$ I have body diff --git a/tests/data/template.html.out b/tests/data/template.html.out index 0b17d31..75ef4df 100644 --- a/tests/data/template.html.out +++ b/tests/data/template.html.out @@ -2,6 +2,7 @@ I'm so rich I have $3. oof + foo I have body -- cgit v1.2.3