Don't generate problematic geopoint names

Turns out that if you have fields from and to, that won't play nicely
with geopoints. Nothing we can do but this should resolve the test error.
This commit is contained in:
Michael Xavier 2016-12-17 13:55:11 -08:00
parent f564d795c6
commit c432993313

View File

@ -872,7 +872,14 @@ instance Arbitrary LessThan where arbitrary = sopArbitrary; shrink = genericShri
instance Arbitrary LessThanEq where arbitrary = sopArbitrary; shrink = genericShrink
instance Arbitrary GreaterThan where arbitrary = sopArbitrary; shrink = genericShrink
instance Arbitrary GreaterThanEq where arbitrary = sopArbitrary; shrink = genericShrink
instance Arbitrary GeoPoint where arbitrary = sopArbitrary; shrink = genericShrink
instance Arbitrary GeoPoint where
arbitrary = GeoPoint <$> (arbitrary `suchThat` reasonableFieldName) <*> arbitrary
where
-- These are problematic for geopoint for obvious reasons
reasonableFieldName (FieldName "from") = False
reasonableFieldName (FieldName "to") = False
reasonableFieldName _ = True
shrink = genericShrink
instance Arbitrary NullValue where arbitrary = sopArbitrary; shrink = genericShrink
instance Arbitrary MinimumMatchHighLow where arbitrary = sopArbitrary; shrink = genericShrink
instance Arbitrary CommonMinimumMatch where arbitrary = sopArbitrary; shrink = genericShrink