summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-14 00:30:36 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-14 00:30:36 -0800
commitd41c17a2d5b3de54334eb05c60be76b468f5811f (patch)
treea0e5fb28c79a368a44e7c4ad723e6298f50e08d2
parentb3fb541d0138fb97ab06e0a2a41f2f37330be557 (diff)
Added quickcheck tests for normalize in Shared.
-rw-r--r--pandoc.cabal7
-rw-r--r--tests/Tests/Shared.hs13
-rw-r--r--tests/test-pandoc.hs7
3 files changed, 23 insertions, 4 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index ad304ec91..20bb6ff3d 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -303,9 +303,12 @@ Executable test-pandoc
else
Ghc-Options: -Wall
Extensions: CPP
- Build-Depends: base >= 4 && < 5, Diff, test-framework,
- test-framework-hunit, HUnit, QuickCheck > 2
+ Build-Depends: base >= 4 && < 5, Diff, test-framework >= 0.3 && < 0.4,
+ test-framework-hunit >= 0.2 && < 0.3,
+ test-framework-quickcheck2 >= 0.2 && < 0.3,
+ HUnit >= 1.2 && < 1.3, QuickCheck >= 2.3 && < 2.5
Other-Modules: Tests.Old
Tests.Helpers
Tests.Arbitrary
+ Tests.Shared
Tests.Readers.LaTeX
diff --git a/tests/Tests/Shared.hs b/tests/Tests/Shared.hs
new file mode 100644
index 000000000..c7222c035
--- /dev/null
+++ b/tests/Tests/Shared.hs
@@ -0,0 +1,13 @@
+module Tests.Shared (tests) where
+import Test.Framework.Providers.QuickCheck2
+import Test.Framework
+import Tests.Arbitrary
+import Text.Pandoc.Shared
+import Text.Pandoc
+
+normalize_rt :: Pandoc -> Bool
+normalize_rt d = normalize (normalize d) == normalize d
+
+tests :: [Test]
+tests = [ testProperty "normalize_rt" normalize_rt ]
+
diff --git a/tests/test-pandoc.hs b/tests/test-pandoc.hs
index b67998177..9f3d65300 100644
--- a/tests/test-pandoc.hs
+++ b/tests/test-pandoc.hs
@@ -6,11 +6,14 @@ import Test.Framework
import qualified Tests.Old
import qualified Tests.Readers.LaTeX
+import qualified Tests.Shared
tests :: [Test]
tests = [ testGroup "Old" Tests.Old.tests
- , testGroup "Readers" [ testGroup "LaTeX" Tests.Readers.LaTeX.tests
- ]
+ , testGroup "Readers"
+ [ testGroup "LaTeX" Tests.Readers.LaTeX.tests
+ ]
+ , testGroup "Shared" Tests.Shared.tests
]
main :: IO ()