on master help sign in
fix StaticOptimizer tests
commit0fc9e0912dfef10766f1cd84c3b4d71539133374 authorDiogo Biazus <diogo@biazus.me> dateThu 11 Jan 2018, 21:19 (9 years ago) parent7142828
1 file changed+5−4
test/Relation/StaticOptimizer.hs+5−4
test/Relation/StaticOptimizer.hs+5−4
@@ -128,10 +128,11 @@ testPushDownRestrictionPredicate = TestCase $ do
128128 [TextAtom "S6", TextAtom "Stevens", IntegerAtom 50, TextAtom "Boston"]] of
129129 Left err -> assertFailure ("stevens relation: " ++ show err) >> pure relationTrue
130130 Right rel -> pure rel
131+ let expr1 = Restrict status30 (Union rvs (ExistingRelation stevens))
132+ status30 = AttributeEqualityPredicate "status" (NakedAtomExpr (IntAtom 30))
131133
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
134+ expectedExpr1 = Union (Restrict status30 rvs) (Restrict status30 (ExistingRelation stevens))
135+ assertEqual "union restriction pushdown" expectedExpr1 (applyStaticRestrictionPushdown expr1)
135136
136137 -- s{sname,city} where city="London" == (s where city="London"){sname,city}
137138 let expr2 = Restrict whereLondon (Project projAttrs2 rvs)
@@ -143,4 +144,4 @@ testPushDownRestrictionPredicate = TestCase $ do
143144 -- (s where city="London"){sname} != s{sname} where city="London" (no "city" attribute at projection time)
144145 let expr3 = Project projAttrs3 (Restrict whereLondon rvs)
145146 projAttrs3 = AttributeNames (S.singleton "sname")
146− assertEqual "projection restriction no-pushdown" expr3 (applyStaticRestrictionPushdown expr3)
147+ assertEqual "projection restriction no-pushdown" expr3 (applyStaticRestrictionPushdown expr3)