git.iko.soy/typeable/bloodhound
on master help sign in
more specific sub-agg test; updated plain stack.yaml
576e25dJosh Berman
stack.yaml+1−10
@@ -3,13 +3,4 @@ packages:
3- '.'
3- '.'
4extra-deps:
4extra-deps:
5- quickcheck-properties-0.1
5- quickcheck-properties-0.1
6−
7−# - http-client-0.5.0
8−# - fail-4.9.0.0
9−# - http-types-0.9
10−# - attoparsec-0.13.0.1
11−# - doctest-0.10.1
12−# - semigroups-0.18.0.1
13−# - uri-bytestring-0.1.9
14−# - temporary-resourcet-0.1.0.0
15−resolver: nightly-2016-08-20
6+resolver: nightly-2017-01-30
tests/V1/tests.hs+3−2
@@ -1314,8 +1314,9 @@ main = hspec $ do
1314 reply <- searchByIndex testIndex search
1314 reply <- searchByIndex testIndex search
1315 let result = decode (responseBody reply) :: Maybe (SearchResult Tweet)
1315 let result = decode (responseBody reply) :: Maybe (SearchResult Tweet)
1316 usersAggResults = result >>= aggregations >>= toTerms "users"
1316 usersAggResults = result >>= aggregations >>= toTerms "users"
1317− subAddResultsExists = maybe (Left False) Right $ ((isJust . termsAggs . head . buckets) <$> usersAggResults)
1317+ subAggResults = usersAggResults >>= (listToMaybe . buckets) >>= termsAggs >>= toTerms "age_agg"
1318+ subAddResultsExists = isJust subAggResults
1318− liftIO $ (subAddResultsExists) `shouldBe` Right True
1319+ liftIO $ (subAddResultsExists) `shouldBe` True
1319
1320
1320 it "returns cardinality aggregation results" $ withTestEnv $ do
1321 it "returns cardinality aggregation results" $ withTestEnv $ do
1321 _ <- insertData
1322 _ <- insertData
tests/V5/tests.hs+3−2
@@ -1129,8 +1129,9 @@ main = hspec $ do
1129 reply <- searchByIndex testIndex search
1129 reply <- searchByIndex testIndex search
1130 let result = decode (responseBody reply) :: Maybe (SearchResult Tweet)
1130 let result = decode (responseBody reply) :: Maybe (SearchResult Tweet)
1131 usersAggResults = result >>= aggregations >>= toTerms "users"
1131 usersAggResults = result >>= aggregations >>= toTerms "users"
1132− subAddResultsExists = maybe (Left False) Right $ ((isJust . termsAggs . head . buckets) <$> usersAggResults)
1132+ subAggResults = usersAggResults >>= (listToMaybe . buckets) >>= termsAggs >>= toTerms "age_agg"
1133+ subAddResultsExists = isJust subAggResults
1133− liftIO $ (subAddResultsExists) `shouldBe` Right True
1134+ liftIO $ (subAddResultsExists) `shouldBe` True
1134
1135
1135 it "returns cardinality aggregation results" $ withTestEnv $ do
1136 it "returns cardinality aggregation results" $ withTestEnv $ do
1136 _ <- insertData
1137 _ <- insertData