mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Add an Arbitrary instance over Source.
This commit is contained in:
parent
62143c1acf
commit
60aecae119
@ -25,6 +25,9 @@ instance Arbitrary a => Arbitrary (Line a) where
|
||||
Line <$> arbitrary,
|
||||
const EmptyLine <$> (arbitrary :: Gen ()) ]
|
||||
|
||||
instance Arbitrary a => Arbitrary (Source a) where
|
||||
arbitrary = makeSource <$> arbitrary
|
||||
|
||||
arbitraryLeaf :: Gen (String, Info, Syntax String f)
|
||||
arbitraryLeaf = toTuple <$> arbitrary
|
||||
where toTuple string = (string, Info (Range 0 $ length string) mempty, Leaf string)
|
||||
|
Loading…
Reference in New Issue
Block a user