1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

arbitraryLeaf doesn’t construct terms.

This commit is contained in:
Rob Rix 2015-12-22 13:29:12 -05:00
parent aaaf8f27a4
commit 0422098f9b

View File

@ -29,9 +29,9 @@ instance Arbitrary a => Arbitrary (Line a) where
Line <$> arbitrary,
const EmptyLine <$> (arbitrary :: Gen ()) ]
arbitraryLeaf :: Int -> (Info -> Syntax String f -> f) -> Gen (String, f)
arbitraryLeaf start f = pairWithLeaf <$> arbitrary
where pairWithLeaf string = (string, f (Info (Range start $ start + length string) mempty) (Leaf string))
arbitraryLeaf :: Int -> Gen (String, Info, Syntax String f)
arbitraryLeaf start = pairWithLeaf <$> arbitrary
where pairWithLeaf string = (string, Info (Range start $ start + length string) mempty, Leaf string)
spec :: Spec
spec = do