git.iko.soy/typeable/pandoc
on master help sign in
Removed tests for Walk; these now live in pandoc-types.
commit2bc0cbc2390201e25ada4be2b936d7165ba650e3 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 16 Jan 2017, 08:30 (10 years ago) parente02e3aa
3 files changed−49
pandoc.cabal−1 tests/Tests/Walk.hs−46 tests/test-pandoc.hs−2
pandoc.cabal−1
@@ -525,7 +525,6 @@ Test-Suite test-pandoc
525525 Other-Modules: Tests.Old
526526 Tests.Helpers
527527 Tests.Shared
528− Tests.Walk
529528 Tests.Readers.LaTeX
530529 Tests.Readers.HTML
531530 Tests.Readers.Markdown
tests/Tests/Walk.hsdeleted−46
@@ -1,46 +0,0 @@
1−{-# LANGUAGE ScopedTypeVariables, FlexibleContexts #-}
2−module Tests.Walk (tests) where
3−
4−import Text.Pandoc.Definition
5−import Text.Pandoc.Walk
6−import Test.Framework
7−import Tests.Helpers
8−import Data.Char (toUpper)
9−import Text.Pandoc.Arbitrary()
10−import Data.Generics
11−
12−tests :: [Test]
13−tests = [ testGroup "Walk"
14− [ property "p_walk inlineTrans" (p_walk inlineTrans)
15− , property "p_walk blockTrans" (p_walk blockTrans)
16− , property "p_query inlineQuery" (p_query inlineQuery)
17− , property "p_query blockQuery" (p_query blockQuery)
18− ]
19− ]
20−
21−p_walk :: (Typeable a, Walkable a Pandoc)
22− => (a -> a) -> Pandoc -> Bool
23−p_walk f d = everywhere (mkT f) d == walk f d
24−
25−p_query :: (Eq a, Typeable a1, Monoid a, Walkable a1 Pandoc)
26− => (a1 -> a) -> Pandoc -> Bool
27−p_query f d = everything mappend (mempty `mkQ` f) d == query f d
28−
29−inlineTrans :: Inline -> Inline
30−inlineTrans (Str xs) = Str $ map toUpper xs
31−inlineTrans (Emph xs) = Strong xs
32−inlineTrans x = x
33−
34−blockTrans :: Block -> Block
35−blockTrans (Plain xs) = Para xs
36−blockTrans (BlockQuote xs) = Div ("",["special"],[]) xs
37−blockTrans x = x
38−
39−inlineQuery :: Inline -> String
40−inlineQuery (Str xs) = xs
41−inlineQuery _ = ""
42−
43−blockQuery :: Block -> [Int]
44−blockQuery (Header lev _ _) = [lev]
45−blockQuery _ = []
46−
tests/test-pandoc.hs−2
@@ -26,14 +26,12 @@ import qualified Tests.Writers.Docx
2626import qualified Tests.Writers.RST
2727import qualified Tests.Writers.TEI
2828import qualified Tests.Shared
29−import qualified Tests.Walk
3029import Text.Pandoc.Shared (inDirectory)
3130import System.Environment (getArgs)
3231
3332tests :: [Test]
3433tests = [ testGroup "Old" Tests.Old.tests
3534 , testGroup "Shared" Tests.Shared.tests
36− , testGroup "Walk" Tests.Walk.tests
3735 , testGroup "Writers"
3836 [ testGroup "Native" Tests.Writers.Native.tests
3937 , testGroup "ConTeXt" Tests.Writers.ConTeXt.tests