git.iko.soy/typeable/bloodhound
on master help sign in
merge
commitb2c4b961405a4dc876c4e1460413fab29040d4f5 authorJosh Berman <berman.josh@gmail.com> dateWed 4 Jan 2017, 21:18 (10 years ago) parent4fcfd59244a123
3 files changed+12−4
.travis.yml+2−1 src/Database/V1/Bloodhound/Types.hs+2−2 tests/V1/tests.hs+8−1
.travis.yml+2−1
@@ -37,7 +37,8 @@ script:
3737 - stack setup
3838 - stack update
3939 - stack build -j1
40− - stack test --flag bloodhound:$ESFLAG
40+ - stack test bloodhound:doctests --flag bloodhound:$ESFLAG
41+ - stack test bloodhound:tests --test-arguments="--qc-max-success 2000" --flag bloodhound:$ESFLAG
4142
4243cache:
4344 directories:
src/Database/V1/Bloodhound/Types.hs+2−2
@@ -2953,7 +2953,7 @@ instance ToJSON MultiMatchQuery where
29532953 , "query" .= query
29542954 , "operator" .= boolOp
29552955 , "zero_terms_query" .= ztQ
2956− , "tiebreaker" .= tb
2956+ , "tie_breaker" .= tb
29572957 , "type" .= mmqt
29582958 , "cutoff_frequency" .= cf
29592959 , "analyzer" .= analyzer
@@ -2968,7 +2968,7 @@ instance FromJSON MultiMatchQuery where
29682968 <*> o .: "query"
29692969 <*> o .: "operator"
29702970 <*> o .: "zero_terms_query"
2971− <*> o .:? "tiebreaker"
2971+ <*> o .:? "tie_breaker"
29722972 <*> o .:? "type"
29732973 <*> o .:? "cutoff_frequency"
29742974 <*> o .:? "analyzer"
tests/V1/tests.hs+8−1
@@ -872,7 +872,14 @@ instance Arbitrary LessThan where arbitrary = sopArbitrary; shrink = genericShri
872872instance Arbitrary LessThanEq where arbitrary = sopArbitrary; shrink = genericShrink
873873instance Arbitrary GreaterThan where arbitrary = sopArbitrary; shrink = genericShrink
874874instance 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
876883instance Arbitrary NullValue where arbitrary = sopArbitrary; shrink = genericShrink
877884instance Arbitrary MinimumMatchHighLow where arbitrary = sopArbitrary; shrink = genericShrink
878885instance Arbitrary CommonMinimumMatch where arbitrary = sopArbitrary; shrink = genericShrink