aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-22 12:18:23 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-22 12:18:23 -0800
commitd86d9260df7fc9addccd289df7a15d9b36b21ae1 (patch)
tree7308a6ae2145bc56386df680e2d78ad5acc1213f
parent8dcc67a993adb2f5b23f1f4a69a4f7f529849eac (diff)
downloadpandoc-d86d9260df7fc9addccd289df7a15d9b36b21ae1.tar.gz
Tests.Arbitrary: Added instances for Inlines, Blocks.
-rw-r--r--tests/Tests/Arbitrary.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/Tests/Arbitrary.hs b/tests/Tests/Arbitrary.hs
index bd506a44f..825902e4c 100644
--- a/tests/Tests/Arbitrary.hs
+++ b/tests/Tests/Arbitrary.hs
@@ -1,4 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# LANGUAGE TypeSynonymInstances #-}
-- provides Arbitrary instance for Pandoc types
module Tests.Arbitrary ()
where
@@ -7,6 +8,7 @@ import Test.QuickCheck.Arbitrary
import Control.Monad (liftM, liftM2)
import Text.Pandoc
import Text.Pandoc.Shared
+import Text.Pandoc.Builder
realString :: Gen String
realString = elements wordlist
@@ -14,6 +16,12 @@ realString = elements wordlist
wordlist :: [String]
wordlist = ["foo","Bar","baz","\\","/",":","\"","'","féé"]
+instance Arbitrary Inlines where
+ arbitrary = liftM fromList arbitrary
+
+instance Arbitrary Blocks where
+ arbitrary = liftM fromList arbitrary
+
instance Arbitrary Inline where
arbitrary = resize 3 $ arbInline 3