@@ -171,15 +171,18 @@ impl EnforceSortingTest {
171171 . indent ( true )
172172 . to_string ( ) ;
173173
174+ let expected_input: Vec < & str > = input_plan_string. trim ( ) . lines ( ) . collect ( ) ;
175+ let expected_optimized: Vec < & str > =optimized_plan_string. trim ( ) . lines ( ) . collect ( ) ;
176+
174177 // return a string with both input and optimized plan
175178 format ! (
176179 "let expected_input = [\n \
177- {input_plan_string }\n \
180+ {expected_input:#? }\n \
178181 ];\n
179182 let expected_optimized = [\n \
180183 ---------------\n \
181184 ];\
182- {optimized_plan_string }",
185+ {expected_optimized:#? }",
183186 )
184187 }
185188}
@@ -290,21 +293,24 @@ async fn test_remove_unnecessary_sort5() -> Result<()> {
290293 plan : physical_plan,
291294 repartition_sorts : true ,
292295 } ;
293- insta:: assert_snapshot!( test. run( ) , @r"
296+ insta:: assert_snapshot!( test. run( ) , @r# "
294297 let expected_input = [
295- SortExec: expr=[a@2 ASC], preserve_partitioning=[false]
296- HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]
297- DataSourceExec: partitions=1, partition_sizes=[0]
298- DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet
299-
298+ [
299+ "SortExec: expr=[a@2 ASC], preserve_partitioning=[false]",
300+ " HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]",
301+ " DataSourceExec: partitions=1, partition_sizes=[0]",
302+ " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet",
303+ ]
300304 ];
301305
302306 let expected_optimized = [
303307 ---------------
304- ];HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]
305- DataSourceExec: partitions=1, partition_sizes=[0]
306- DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet
307- " ) ;
308+ ];[
309+ "HashJoinExec: mode=Partitioned, join_type=Inner, on=[(col_a@0, c@2)]",
310+ " DataSourceExec: partitions=1, partition_sizes=[0]",
311+ " DataSourceExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], output_ordering=[a@0 ASC], file_type=parquet",
312+ ]
313+ "# ) ;
308314 Ok ( ( ) )
309315}
310316
0 commit comments