mirror of
https://github.com/typeable/bloodhound.git
synced 2024-12-02 06:30:29 +03:00
V1 ditto
This commit is contained in:
parent
62959bcbfe
commit
35f1de13e3
@ -717,6 +717,17 @@ instance Arbitrary FieldName where
|
||||
shrink = genericShrink
|
||||
|
||||
|
||||
#if MIN_VERSION_base(4,10,0)
|
||||
-- Test.QuickCheck.Modifiers
|
||||
|
||||
qcNonEmptyToNonEmpty :: NonEmptyList a -> NonEmpty a
|
||||
qcNonEmptyToNonEmpty (NonEmpty (a : xs)) = (a :| xs)
|
||||
qcNonEmptyToNonEmpty (NonEmpty []) = error "NonEmpty was empty!"
|
||||
|
||||
instance Arbitrary a => Arbitrary (NonEmpty a) where
|
||||
arbitrary = qcNonEmptyToNonEmpty <$> arbitrary
|
||||
#endif
|
||||
|
||||
instance Arbitrary RegexpFlags where
|
||||
arbitrary = oneof [ pure AllRegexpFlags
|
||||
, pure NoRegexpFlags
|
||||
|
Loading…
Reference in New Issue
Block a user