git.iko.soy/typeable/pandoc
on master help sign in
Added Tests.Shared with normalize round-trip tests.
commit0833daff4af7ce17aa0a77528731f30ec127bc68 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 29 Jan 2011, 10:03 (16 years ago) parent18089a4
3 files changed+24
pandoc.cabal+1 tests/Tests/Shared.hs+21 tests/test-pandoc.hs+2
pandoc.cabal+1
@@ -355,6 +355,7 @@ Executable test-pandoc
355355 Other-Modules: Tests.Old
356356 Tests.Helpers
357357 Tests.Arbitrary
358+ Tests.Shared
358359 Tests.Readers.LaTeX
359360 Tests.Readers.Markdown
360361 Tests.Readers.RST
tests/Tests/Shared.hsnew file+21
@@ -0,0 +1,21 @@
1+module Tests.Shared (tests) where
2+
3+import Text.Pandoc.Definition
4+import Text.Pandoc.Shared
5+import Test.Framework
6+import Tests.Helpers
7+import Tests.Arbitrary()
8+
9+tests :: [Test]
10+tests = [ testGroup "normalize"
11+ [ property "p_normalize_blocks_rt" p_normalize_blocks_rt
12+ , property "p_normalize_inlines_rt" p_normalize_inlines_rt
13+ ]
14+ ]
15+
16+p_normalize_blocks_rt :: [Block] -> Bool
17+p_normalize_blocks_rt bs = normalize bs == normalize (normalize bs)
18+
19+p_normalize_inlines_rt :: [Inline] -> Bool
20+p_normalize_inlines_rt ils = normalize ils == normalize (normalize ils)
21+
tests/test-pandoc.hs+2
@@ -10,9 +10,11 @@ import qualified Tests.Readers.Markdown
1010import qualified Tests.Readers.RST
1111import qualified Tests.Writers.ConTeXt
1212import qualified Tests.Writers.Native
13+import qualified Tests.Shared
1314
1415tests :: [Test]
1516tests = [ testGroup "Old" Tests.Old.tests
17+ , testGroup "Shared" Tests.Shared.tests
1618 , testGroup "Writers"
1719 [ testGroup "Native" Tests.Writers.Native.tests
1820 , testGroup "ConTeXt" Tests.Writers.ConTeXt.tests