git.iko.soy/typeable/bloodhound
on master help sign in
merge with upstream master
commitecabdbe0948ac1ce28be87a75360cf7a02f30bc3 authorJosh Berman <berman.josh@gmail.com> dateMon 25 Dec 2017, 07:40 (9 years ago) parentea32ac535f1de1
3 files changed+24−10
stack-8.0.yaml+1−10 tests/V1/tests.hs+11 tests/V5/tests.hs+12
stack-8.0.yaml+1−10
@@ -6,15 +6,6 @@ packages:
66- '.'
77- './examples'
88extra-deps:
9−# - http-client-0.5.0
10−# - aeson-1.2.0.0
11−# - fail-4.9.0.0
12−# - http-types-0.9
13−# - attoparsec-0.13.0.1
14−- quickcheck-properties-0.1
15−# - semigroups-0.18.3
16−# - uri-bytestring-0.1.9
17−# - temporary-resourcet-0.1.0.0
18−# - transformers-compat-0.5.1.4
9+ - quickcheck-properties-0.1
1910
2011resolver: lts-8.14
tests/V1/tests.hs+11
@@ -719,6 +719,17 @@ instance Arbitrary FieldName where
719719 shrink = genericShrink
720720
721721
722+#if MIN_VERSION_base(4,10,0)
723+-- Test.QuickCheck.Modifiers
724+
725+qcNonEmptyToNonEmpty :: NonEmptyList a -> NonEmpty a
726+qcNonEmptyToNonEmpty (NonEmpty (a : xs)) = (a :| xs)
727+qcNonEmptyToNonEmpty (NonEmpty []) = error "NonEmpty was empty!"
728+
729+instance Arbitrary a => Arbitrary (NonEmpty a) where
730+ arbitrary = qcNonEmptyToNonEmpty <$> arbitrary
731+#endif
732+
722733instance Arbitrary RegexpFlags where
723734 arbitrary = oneof [ pure AllRegexpFlags
724735 , pure NoRegexpFlags
tests/V5/tests.hs+12
@@ -731,12 +731,24 @@ instance Arbitrary FieldName where
731731 shrink = genericShrink
732732
733733
734+#if MIN_VERSION_base(4,10,0)
735+-- Test.QuickCheck.Modifiers
736+
737+qcNonEmptyToNonEmpty :: NonEmptyList a -> NonEmpty a
738+qcNonEmptyToNonEmpty (NonEmpty (a : xs)) = (a :| xs)
739+qcNonEmptyToNonEmpty (NonEmpty []) = error "NonEmpty was empty!"
740+
741+instance Arbitrary a => Arbitrary (NonEmpty a) where
742+ arbitrary = qcNonEmptyToNonEmpty <$> arbitrary
743+#endif
744+
734745instance Arbitrary RegexpFlags where
735746 arbitrary = oneof [ pure AllRegexpFlags
736747 , pure NoRegexpFlags
737748 , SomeRegexpFlags <$> genUniqueFlags
738749 ]
739750 where genUniqueFlags = NE.fromList . nub <$> listOf1 arbitrary
751+
740752 shrink = genericShrink
741753
742754