@@ -124,15 +124,14 @@ testPushDownRestrictionPredicate :: Test
124124testPushDownRestrictionPredicate = TestCase $ do
125125 -- (s union relation{tuple{city "Boston", s# "S6", sname "Stevens", status 50}}) where status = 30 == (s where status=30) union (relation{tuple{city "Boston", s# "S6", sname "Stevens", status 50}} where status=30)
126126 let rvs = RelationVariable "s" ()
127− stevens <- case mkRelationFromList (attributes suppliersRel) [
128− [TextAtom "S6", TextAtom "Stevens", IntegerAtom 50, TextAtom "Boston"]] of
129− Left err -> assertFailure $ "stevens relation: " ++ show err
130− Right rel -> pure rel
131− let expr1 = Restrict status30 (Union rvs (ExistingRelation stevens))
132− status30 = AttributeEqualityPredicate "status" (NakedAtomExpr (IntAtom 30))
127+ relationsOrError = do
128+ stevens <- mkRelationFromList (attributes suppliersRel) [[TextAtom "S6", TextAtom "Stevens", IntegerAtom 50, TextAtom "Boston"]]
129+ let expr1 = Restrict status30 (Union rvs (ExistingRelation stevens))
130+ status30 = AttributeEqualityPredicate "status" (NakedAtomExpr (IntAtom 30))
133131
134− expectedExpr1 = Union (Restrict status30 rvs) (Restrict status30 (ExistingRelation stevens))
135− assertEqual "union restriction pushdown" expectedExpr1 (applyStaticRestrictionPushdown expr1)
132+ expectedExpr1 = Union (Restrict status30 rvs) (Restrict status30 (ExistingRelation stevens))
133+ pure $ (expectedExpr1, (applyStaticRestrictionPushdown expr1))
134+ either (assertFailure . (++) "stevens relation: " . show) (uncurry $ assertEqual "union restriction pushdown") relationsOrError
136135
137136 -- s{sname,city} where city="London" == (s where city="London"){sname,city}
138137 let expr2 = Restrict whereLondon (Project projAttrs2 rvs)
@@ -144,4 +143,4 @@ testPushDownRestrictionPredicate = TestCase $ do
144143 -- (s where city="London"){sname} != s{sname} where city="London" (no "city" attribute at projection time)
145144 let expr3 = Project projAttrs3 (Restrict whereLondon rvs)
146145 projAttrs3 = AttributeNames (S.singleton "sname")
147− assertEqual "projection restriction no-pushdown" expr3 (applyStaticRestrictionPushdown expr3)
146+ assertEqual "projection restriction no-pushdown" expr3 (applyStaticRestrictionPushdown expr3)