diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-02-14 10:08:21 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-02-14 10:08:21 +0100 |
commit | 61dcb5f454fcbd912b09839021f4c79ca60973fe (patch) | |
tree | 37b39b20bc3f5325d2c13939c03ce286162eb354 /tests | |
parent | 2912fcd521d0d9fbe93dae37783f5f379893ddb1 (diff) | |
parent | 02a92d54cdee8299aac0f55cbe4a930ac5060d20 (diff) | |
download | hakyll-61dcb5f454fcbd912b09839021f4c79ca60973fe.tar.gz |
Merge branch 'master' into dev-metadata-route
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Hakyll/Core/Provider/Tests.hs | 1 | ||||
-rw-r--r-- | tests/Hakyll/Core/Rules/Tests.hs | 1 | ||||
-rw-r--r-- | tests/Hakyll/Core/Store/Tests.hs | 1 | ||||
-rw-r--r-- | tests/Hakyll/Web/Pandoc/FileType/Tests.hs | 26 | ||||
-rw-r--r-- | tests/Hakyll/Web/Template/Tests.hs | 2 | ||||
-rw-r--r-- | tests/TestSuite.hs | 2 |
6 files changed, 33 insertions, 0 deletions
diff --git a/tests/Hakyll/Core/Provider/Tests.hs b/tests/Hakyll/Core/Provider/Tests.hs index 5fd9c0d..abe5c1d 100644 --- a/tests/Hakyll/Core/Provider/Tests.hs +++ b/tests/Hakyll/Core/Provider/Tests.hs @@ -37,3 +37,4 @@ case01 = do doesntExist <- resourceMetadata provider "doesntexist.md" M.empty @=? doesntExist + cleanTestEnv diff --git a/tests/Hakyll/Core/Rules/Tests.hs b/tests/Hakyll/Core/Rules/Tests.hs index 1701cff..908f712 100644 --- a/tests/Hakyll/Core/Rules/Tests.hs +++ b/tests/Hakyll/Core/Rules/Tests.hs @@ -53,6 +53,7 @@ rulesTest = do checkRoute "example.mv1" (sv "mv1" "example.md") checkRoute "example.mv2" (sv "mv2" "example.md") readIORef ioref >>= assert + cleanTestEnv where sv g = setVersion (Just g) expected = diff --git a/tests/Hakyll/Core/Store/Tests.hs b/tests/Hakyll/Core/Store/Tests.hs index 19b268b..95140e3 100644 --- a/tests/Hakyll/Core/Store/Tests.hs +++ b/tests/Hakyll/Core/Store/Tests.hs @@ -67,3 +67,4 @@ wrongType = do e == typeOf (undefined :: Int) && t == typeOf (undefined :: String) _ -> False + cleanTestEnv diff --git a/tests/Hakyll/Web/Pandoc/FileType/Tests.hs b/tests/Hakyll/Web/Pandoc/FileType/Tests.hs new file mode 100644 index 0000000..e6b222f --- /dev/null +++ b/tests/Hakyll/Web/Pandoc/FileType/Tests.hs @@ -0,0 +1,26 @@ +-------------------------------------------------------------------------------- +{-# LANGUAGE OverloadedStrings #-} +module Hakyll.Web.Pandoc.FileType.Tests + ( tests + ) where + + +-------------------------------------------------------------------------------- +import Test.Framework (Test, testGroup) +import Test.HUnit ((@=?)) + + +-------------------------------------------------------------------------------- +import Hakyll.Web.Pandoc.FileType +import TestSuite.Util + + +-------------------------------------------------------------------------------- +tests :: Test +tests = testGroup "Hakyll.Web.Pandoc.FileType.Tests" $ + fromAssertions "fileType" + [ Markdown @=? fileType "index.md" + , Rst @=? fileType "about/foo.rst" + , LiterateHaskell Markdown @=? fileType "posts/bananas.lhs" + , LiterateHaskell LaTeX @=? fileType "posts/bananas.tex.lhs" + ] diff --git a/tests/Hakyll/Web/Template/Tests.hs b/tests/Hakyll/Web/Template/Tests.hs index 6fb5233..b96cfa5 100644 --- a/tests/Hakyll/Web/Template/Tests.hs +++ b/tests/Hakyll/Web/Template/Tests.hs @@ -44,6 +44,7 @@ case01 = do pandocCompiler >>= applyTemplate (itemBody tpl) testContext out @=? itemBody item + cleanTestEnv -------------------------------------------------------------------------------- @@ -63,6 +64,7 @@ testApplyJoinTemplateList = do applyJoinTemplateList ", " tpl defaultContext [i1, i2] str @?= "<b>Hello</b>, <b>World</b>" + cleanTestEnv where i1 = Item "item1" "Hello" i2 = Item "item2" "World" diff --git a/tests/TestSuite.hs b/tests/TestSuite.hs index 9be857c..7c913dd 100644 --- a/tests/TestSuite.hs +++ b/tests/TestSuite.hs @@ -20,6 +20,7 @@ import qualified Hakyll.Core.UnixFilter.Tests import qualified Hakyll.Core.Util.String.Tests import qualified Hakyll.Web.Html.RelativizeUrls.Tests import qualified Hakyll.Web.Html.Tests +import qualified Hakyll.Web.Pandoc.FileType.Tests import qualified Hakyll.Web.Template.Context.Tests import qualified Hakyll.Web.Template.Tests @@ -38,6 +39,7 @@ main = defaultMain , Hakyll.Core.Util.String.Tests.tests , Hakyll.Web.Html.RelativizeUrls.Tests.tests , Hakyll.Web.Html.Tests.tests + , Hakyll.Web.Pandoc.FileType.Tests.tests , Hakyll.Web.Template.Context.Tests.tests , Hakyll.Web.Template.Tests.tests ] |