git.iko.soy/typeable/pandoc
on master help sign in
Tweaked Arbitrary instance to help avoid timeouts in tests.
77cf7f9John MacFarlane
src/Tests/Arbitrary.hs+2−2
@@ -28,7 +28,7 @@ instance Arbitrary Blocks where
28 arbitrary = liftM fromList arbitrary
28 arbitrary = liftM fromList arbitrary
29
29
30instance Arbitrary Inline where
30instance Arbitrary Inline where
31− arbitrary = resize 3 $ arbInline 3
31+ arbitrary = resize 3 $ arbInline 2
32
32
33arbInlines :: Int -> Gen [Inline]
33arbInlines :: Int -> Gen [Inline]
34arbInlines n = listOf1 (arbInline n) `suchThat` (not . startsWithSpace)
34arbInlines n = listOf1 (arbInline n) `suchThat` (not . startsWithSpace)
@@ -72,7 +72,7 @@ arbInline n = frequency $ [ (60, liftM Str realString)
72 ]
72 ]
73
73
74instance Arbitrary Block where
74instance Arbitrary Block where
75− arbitrary = resize 3 $ arbBlock 3
75+ arbitrary = resize 3 $ arbBlock 2
76
76
77arbBlock :: Int -> Gen Block
77arbBlock :: Int -> Gen Block
78arbBlock n = frequency $ [ (10, liftM Plain $ arbInlines (n-1))
78arbBlock n = frequency $ [ (10, liftM Plain $ arbInlines (n-1))