From f8a34f1694c9fda3319fcface155eed97608ded1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 29 Apr 2014 18:32:42 -0700 Subject: Added Cite to Arbitrary instance. See #1269. This reveals some test failures. --- tests/Tests/Arbitrary.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/Tests/Arbitrary.hs') diff --git a/tests/Tests/Arbitrary.hs b/tests/Tests/Arbitrary.hs index 82346d65f..3675d97bf 100644 --- a/tests/Tests/Arbitrary.hs +++ b/tests/Tests/Arbitrary.hs @@ -64,6 +64,7 @@ arbInline n = frequency $ [ (60, liftM Str realString) x3 <- realString x2 <- liftM escapeURI realString return $ Image x1 (x2,x3)) + , (2, liftM2 Cite arbitrary (arbInlines 1)) , (2, liftM Note $ resize 3 $ listOf1 $ arbBlock (n-1)) ] @@ -111,7 +112,6 @@ instance Arbitrary Pandoc where arbitrary = resize 8 $ liftM normalize $ liftM2 Pandoc arbitrary arbitrary -{- instance Arbitrary CitationMode where arbitrary = do x <- choose (0 :: Int, 2) @@ -123,14 +123,13 @@ instance Arbitrary CitationMode where instance Arbitrary Citation where arbitrary - = do x1 <- liftM (filter (`notElem` ",;]@ \t\n")) arbitrary - x2 <- arbitrary - x3 <- arbitrary + = do x1 <- listOf $ elements $ ['a'..'z'] ++ ['0'..'9'] ++ ['_'] + x2 <- arbInlines 1 + x3 <- arbInlines 1 x4 <- arbitrary x5 <- arbitrary x6 <- arbitrary return (Citation x1 x2 x3 x4 x5 x6) --} instance Arbitrary MathType where arbitrary -- cgit v1.2.3