git.iko.soy/typeable/bloodhound
on master help sign in
Don't generate problematic geopoint names
c432993Michael Xavier
tests/tests.hs+8−1
@@ -872,7 +872,14 @@ instance Arbitrary LessThan where arbitrary = sopArbitrary; shrink = genericShri
872instance Arbitrary LessThanEq where arbitrary = sopArbitrary; shrink = genericShrink
872instance Arbitrary LessThanEq where arbitrary = sopArbitrary; shrink = genericShrink
873instance Arbitrary GreaterThan where arbitrary = sopArbitrary; shrink = genericShrink
873instance Arbitrary GreaterThan where arbitrary = sopArbitrary; shrink = genericShrink
874instance Arbitrary GreaterThanEq where arbitrary = sopArbitrary; shrink = genericShrink
874instance Arbitrary GreaterThanEq where arbitrary = sopArbitrary; shrink = genericShrink
875−instance Arbitrary GeoPoint where arbitrary = sopArbitrary; shrink = genericShrink
875+instance Arbitrary GeoPoint where
876+ arbitrary = GeoPoint <$> (arbitrary `suchThat` reasonableFieldName) <*> arbitrary
877+ where
878+ -- These are problematic for geopoint for obvious reasons
879+ reasonableFieldName (FieldName "from") = False
880+ reasonableFieldName (FieldName "to") = False
881+ reasonableFieldName _ = True
882+ shrink = genericShrink
876instance Arbitrary NullValue where arbitrary = sopArbitrary; shrink = genericShrink
883instance Arbitrary NullValue where arbitrary = sopArbitrary; shrink = genericShrink
877instance Arbitrary MinimumMatchHighLow where arbitrary = sopArbitrary; shrink = genericShrink
884instance Arbitrary MinimumMatchHighLow where arbitrary = sopArbitrary; shrink = genericShrink
878instance Arbitrary CommonMinimumMatch where arbitrary = sopArbitrary; shrink = genericShrink
885instance Arbitrary CommonMinimumMatch where arbitrary = sopArbitrary; shrink = genericShrink