diff --git a/test/Spec.hs b/test/Spec.hs index f462a8d9b..6837f6d98 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -36,11 +36,11 @@ instance (Arbitrary a, Arbitrary annotation) => Arbitrary (ArbitraryTerm a annot arbitraryBounded :: (Arbitrary a, Arbitrary annotation) => Int -> Gen (ArbitraryTerm a annotation) arbitraryBounded k = make <$> arbitrary <*> oneof [ - ArbitrarySyntax . Leaf <$> arbitrary, - ArbitrarySyntax . Indexed <$> vectorOfAtMost k (arbitraryBounded $ k - 1), - ArbitrarySyntax . Syntax.Fixed <$> vectorOfAtMost k (arbitraryBounded $ k - 1), - ArbitrarySyntax . Keyed . Map.fromList <$> arbitrary ] - where make annotation syntax = ArbitraryTerm $ (annotation, unSyntax syntax) + Leaf <$> arbitrary, + Indexed <$> vectorOfAtMost k (arbitraryBounded $ k - 1), + Syntax.Fixed <$> vectorOfAtMost k (arbitraryBounded $ k - 1), + Keyed . Map.fromList <$> arbitrary ] + where make annotation syntax = ArbitraryTerm $ (annotation, syntax) vectorOfAtMost k gen = choose (0, k) >>= \n -> vectorOf n gen instance Arbitrary HTML where