Added Tests.Shared with normalize round-trip tests.

This commit is contained in:
John MacFarlane 2011-01-29 10:03:00 -08:00
parent 18089a44f5
commit 0833daff4a
3 changed files with 24 additions and 0 deletions

View file

@ -355,6 +355,7 @@ Executable test-pandoc
Other-Modules: Tests.Old
Tests.Helpers
Tests.Arbitrary
Tests.Shared
Tests.Readers.LaTeX
Tests.Readers.Markdown
Tests.Readers.RST

21
tests/Tests/Shared.hs Normal file
View file

@ -0,0 +1,21 @@
module Tests.Shared (tests) where
import Text.Pandoc.Definition
import Text.Pandoc.Shared
import Test.Framework
import Tests.Helpers
import Tests.Arbitrary()
tests :: [Test]
tests = [ testGroup "normalize"
[ property "p_normalize_blocks_rt" p_normalize_blocks_rt
, property "p_normalize_inlines_rt" p_normalize_inlines_rt
]
]
p_normalize_blocks_rt :: [Block] -> Bool
p_normalize_blocks_rt bs = normalize bs == normalize (normalize bs)
p_normalize_inlines_rt :: [Inline] -> Bool
p_normalize_inlines_rt ils = normalize ils == normalize (normalize ils)

View file

@ -10,9 +10,11 @@ import qualified Tests.Readers.Markdown
import qualified Tests.Readers.RST
import qualified Tests.Writers.ConTeXt
import qualified Tests.Writers.Native
import qualified Tests.Shared
tests :: [Test]
tests = [ testGroup "Old" Tests.Old.tests
, testGroup "Shared" Tests.Shared.tests
, testGroup "Writers"
[ testGroup "Native" Tests.Writers.Native.tests
, testGroup "ConTeXt" Tests.Writers.ConTeXt.tests