@@ -255,9 +255,8 @@ mod tests {
255255 use crate :: eliminate_filter:: EliminateFilter ;
256256 use crate :: eliminate_nested_union:: EliminateNestedUnion ;
257257 use crate :: test:: {
258- assert_optimized_plan_eq, assert_optimized_plan_eq_with_rules,
259- assert_optimized_plan_ne_with_rules, test_table_scan, test_table_scan_fields,
260- test_table_scan_with_name,
258+ assert_optimized_plan_eq, assert_optimized_plan_with_rules, test_table_scan,
259+ test_table_scan_fields, test_table_scan_with_name,
261260 } ;
262261
263262 use super :: * ;
@@ -266,33 +265,20 @@ mod tests {
266265 assert_optimized_plan_eq ( Arc :: new ( PropagateEmptyRelation :: new ( ) ) , plan, expected)
267266 }
268267
269- fn assert_together_optimized_plan_eq (
270- plan : LogicalPlan ,
271- expected : & str ,
272- ) -> Result < ( ) > {
273- assert_optimized_plan_eq_with_rules (
274- vec ! [
275- Arc :: new( EliminateFilter :: new( ) ) ,
276- Arc :: new( EliminateNestedUnion :: new( ) ) ,
277- Arc :: new( PropagateEmptyRelation :: new( ) ) ,
278- ] ,
279- plan,
280- expected,
281- )
282- }
283-
284- fn assert_together_optimized_plan_ne (
268+ fn assert_together_optimized_plan (
285269 plan : LogicalPlan ,
286270 expected : & str ,
271+ eq : bool ,
287272 ) -> Result < ( ) > {
288- assert_optimized_plan_ne_with_rules (
273+ assert_optimized_plan_with_rules (
289274 vec ! [
290275 Arc :: new( EliminateFilter :: new( ) ) ,
291276 Arc :: new( EliminateNestedUnion :: new( ) ) ,
292277 Arc :: new( PropagateEmptyRelation :: new( ) ) ,
293278 ] ,
294279 plan,
295280 expected,
281+ eq,
296282 )
297283 }
298284
@@ -328,7 +314,7 @@ mod tests {
328314 . build ( ) ?;
329315
330316 let expected = "EmptyRelation" ;
331- assert_together_optimized_plan_eq ( plan, expected)
317+ assert_together_optimized_plan ( plan, expected, true )
332318 }
333319
334320 #[ test]
@@ -341,7 +327,7 @@ mod tests {
341327 let plan = LogicalPlanBuilder :: from ( left) . union ( right) ?. build ( ) ?;
342328
343329 let expected = "TableScan: test" ;
344- assert_together_optimized_plan_eq ( plan, expected)
330+ assert_together_optimized_plan ( plan, expected, true )
345331 }
346332
347333 #[ test]
@@ -366,7 +352,7 @@ mod tests {
366352 let expected = "Union\
367353 \n TableScan: test1\
368354 \n TableScan: test4";
369- assert_together_optimized_plan_eq ( plan, expected)
355+ assert_together_optimized_plan ( plan, expected, true )
370356 }
371357
372358 #[ test]
@@ -391,7 +377,7 @@ mod tests {
391377 . build ( ) ?;
392378
393379 let expected = "EmptyRelation" ;
394- assert_together_optimized_plan_eq ( plan, expected)
380+ assert_together_optimized_plan ( plan, expected, true )
395381 }
396382
397383 #[ test]
@@ -418,7 +404,7 @@ mod tests {
418404 let expected = "Union\
419405 \n TableScan: test2\
420406 \n TableScan: test3";
421- assert_together_optimized_plan_eq ( plan, expected)
407+ assert_together_optimized_plan ( plan, expected, true )
422408 }
423409
424410 #[ test]
@@ -431,7 +417,7 @@ mod tests {
431417 let plan = LogicalPlanBuilder :: from ( left) . union ( right) ?. build ( ) ?;
432418
433419 let expected = "TableScan: test" ;
434- assert_together_optimized_plan_eq ( plan, expected)
420+ assert_together_optimized_plan ( plan, expected, true )
435421 }
436422
437423 #[ test]
@@ -446,7 +432,7 @@ mod tests {
446432 . build ( ) ?;
447433
448434 let expected = "EmptyRelation" ;
449- assert_together_optimized_plan_eq ( plan, expected)
435+ assert_together_optimized_plan ( plan, expected, true )
450436 }
451437
452438 fn empty_left_and_right_lp_empty (
@@ -486,12 +472,7 @@ mod tests {
486472 . build ( ) ?;
487473
488474 let expected = "EmptyRelation" ;
489-
490- if eq {
491- assert_together_optimized_plan_eq ( plan, expected)
492- } else {
493- assert_together_optimized_plan_ne ( plan, expected)
494- }
475+ assert_together_optimized_plan ( plan, expected, eq)
495476 }
496477
497478 #[ test]
@@ -580,6 +561,6 @@ mod tests {
580561 let expected = "Projection: a, b, c\
581562 \n TableScan: test";
582563
583- assert_together_optimized_plan_eq ( plan, expected)
564+ assert_together_optimized_plan ( plan, expected, true )
584565 }
585566}
0 commit comments