@@ -13,11 +13,9 @@ import Test.Tasty.HUnit (Assertion, testCase, (@=?))
13--------------------------------------------------------------------------------
13--------------------------------------------------------------------------------
14import Hakyll.Core.Compiler
14import Hakyll.Core.Compiler
15import Hakyll.Core.Identifier
15import Hakyll.Core.Identifier
16−import Hakyll.Core.Item
17import Hakyll.Core.Provider
16import Hakyll.Core.Provider
18import Hakyll.Core.Store (Store)
17import Hakyll.Core.Store (Store)
19import Hakyll.Web.Template.Context
18import Hakyll.Web.Template.Context
20−import Hakyll.Web.Template.Internal
21import TestSuite.Util
19import TestSuite.Util
@@ -25,7 +23,6 @@ import TestSuite.Util
25tests :: TestTree
23tests :: TestTree
26tests = testGroup "Hakyll.Web.Template.Context.Tests"
24tests = testGroup "Hakyll.Web.Template.Context.Tests"
27 [ testCase "testDateField" testDateField
25 [ testCase "testDateField" testDateField
28− , testCase "testOuerLoopContextAccess" testOuerLoopContextAccess
@@ -68,28 +65,3 @@ testContextDone store provider identifier key context =
68 _ -> error $
65 _ -> error $
69 "Hakyll.Web.Template.Context.Tests.testContextDone: " ++
66 "Hakyll.Web.Template.Context.Tests.testContextDone: " ++
70 "expected StringField"
67 "expected StringField"
72−--------------------------------------------------------------------------------
74−testOuerLoopContextAccess :: Assertion
75−testOuerLoopContextAccess = do
76− store <- newTestStore
77− provider <- newTestProvider store
78− test store provider ctx "baz"
79− test store provider (ctx' <> ctx) "not baz"
80− test store provider (ctx <> ctx') "baz"
84− tpl = readTemplate "$for(foo)$$for(bar)$$qux$$endfor$$endfor$"
86− field "qux" $ const $ return "baz"
87− , listField "foo" (listField "bar" mempty $ return [mockItem])
90− ctx' = field "qux" $ const $ return "not baz"
91− mockItem = Item "" ()
92− test store provider context str = do
93− str' <- testCompilerDone store provider ""
94− $ applyTemplate tpl context mockItem
95− str @=? itemBody str'