Revert "Added test case for global metadata"

This reverts commit 46b6f78da8.

Conflicts:
	tests/data/posts/metadata
This commit is contained in:
Jasper Van der Jeugt 2014-03-26 11:28:55 +01:00
parent 3db3933b0b
commit e5446fd401
7 changed files with 1 additions and 87 deletions

View file

@ -151,7 +151,7 @@ loadGlobalMetadata p fp = liftM M.fromList $ loadgm fp where
-- TODO: It might be better to print warning and continue
in either (error.show) (findMetadata dir) . P.parse namedMetadata path <$> readFile path
findMetadata dir =
concatMap snd . filter (flip matches fp . fromGlob . normalise . combine dir . fst)
concatMap snd . filter (flip matches fp . fromGlob . combine dir . fst)
namedMetadata :: Parser [(String, [(String, String)])]
namedMetadata = liftA2 (:) (namedMetadataBlock False) $ P.many $ namedMetadataBlock True

View file

@ -1,31 +0,0 @@
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Core.Provider.GlobalMetadata.Tests
( tests
) where
--------------------------------------------------------------------------------
import qualified Data.Map as M
import Control.Monad (forM_)
import Test.Framework (Test, testGroup)
import Test.HUnit (Assertion, (@=?))
--------------------------------------------------------------------------------
import Hakyll.Core.Provider (resourceMetadata)
import TestSuite.Util
--------------------------------------------------------------------------------
tests :: Test
tests = testGroup "Hakyll.Core.Provider.GlobalMetadata.Tests" $
fromAssertions "page" [testPage]
testPage :: Assertion
testPage = do
store <- newTestStore
provider <- newTestProvider store
metadata <- resourceMetadata provider "posts/2013-10-18-metadata-test.md"
forM_ ["1", "2", "3", "4", "5", "6", "7", "8"] $ \a ->
Just a @=? M.lookup ('a':a) metadata

View file

@ -12,7 +12,6 @@ import Test.Framework (defaultMain)
import qualified Hakyll.Core.Dependencies.Tests
import qualified Hakyll.Core.Identifier.Tests
import qualified Hakyll.Core.Provider.Metadata.Tests
import qualified Hakyll.Core.Provider.GlobalMetadata.Tests
import qualified Hakyll.Core.Provider.Tests
import qualified Hakyll.Core.Routes.Tests
import qualified Hakyll.Core.Rules.Tests
@ -33,7 +32,6 @@ main = defaultMain
[ Hakyll.Core.Dependencies.Tests.tests
, Hakyll.Core.Identifier.Tests.tests
, Hakyll.Core.Provider.Metadata.Tests.tests
, Hakyll.Core.Provider.GlobalMetadata.Tests.tests
, Hakyll.Core.Provider.Tests.tests
, Hakyll.Core.Routes.Tests.tests
, Hakyll.Core.Rules.Tests.tests

View file

@ -1,27 +0,0 @@
--- posts/2013-10-18-metadata-test.md
a1: 8
a2: 8
a3: 8
a4: 8
a5: 8
a6: 8
a7: 8
a8: 8
--- posts/*
a1: 7
a2: 7
a3: 7
a4: 7
a5: 7
a6: 7
a7: 7
--- **
a1: 6
a2: 6
a3: 6
a4: 6
a5: 6
a6: 6

View file

@ -1,4 +0,0 @@
---
a1: 1
---
Nothing interesting here.

View file

@ -1,2 +0,0 @@
a1: 2
a2: 2

View file

@ -1,20 +0,0 @@
--- **
a1: 5
a2: 5
a3: 5
a4: 5
a5: 5
--- *
a1: 4
a2: 4
a3: 4
a4: 4
--- 2013-10-18-metadata-test.md
a1: 3
a2: 3
a3: 3
--- nonexistent
a3: 0