@@ -113,6 +113,7 @@ mod tests {
113113 } ;
114114 use arrow:: datatypes:: { Field , Schema , SchemaRef } ;
115115 use arrow:: util:: pretty:: pretty_format_batches;
116+ use insta:: assert_snapshot;
116117 use std:: sync:: Arc ;
117118
118119 #[ test]
@@ -180,15 +181,15 @@ mod tests {
180181 let cols = agg. emit ( ) ?;
181182 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
182183 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
183- let expected = r#"
184+
185+ assert_snapshot ! ( actual, @r#"
184186+----------+--------------+
185187| trace_id | timestamp_ms |
186188+----------+--------------+
187189| 1 | 1 |
188190+----------+--------------+
189191 "#
190- . trim ( ) ;
191- assert_eq ! ( actual, expected) ;
192+ ) ;
192193
193194 Ok ( ( ) )
194195 }
@@ -205,15 +206,15 @@ mod tests {
205206 let cols = agg. emit ( ) ?;
206207 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
207208 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
208- let expected = r#"
209+
210+ assert_snapshot ! ( actual, @r#"
209211+----------+--------------+
210212| trace_id | timestamp_ms |
211213+----------+--------------+
212214| 1 | 1 |
213215+----------+--------------+
214216 "#
215- . trim ( ) ;
216- assert_eq ! ( actual, expected) ;
217+ ) ;
217218
218219 Ok ( ( ) )
219220 }
@@ -230,15 +231,14 @@ mod tests {
230231 let cols = agg. emit ( ) ?;
231232 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
232233 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
233- let expected = r#"
234+ assert_snapshot ! ( actual , @ r#"
234235+----------+--------------+
235236| trace_id | timestamp_ms |
236237+----------+--------------+
237238| 2 | 2 |
238239+----------+--------------+
239240 "#
240- . trim ( ) ;
241- assert_eq ! ( actual, expected) ;
241+ ) ;
242242
243243 Ok ( ( ) )
244244 }
@@ -255,15 +255,14 @@ mod tests {
255255 let cols = agg. emit ( ) ?;
256256 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
257257 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
258- let expected = r#"
258+ assert_snapshot ! ( actual , @ r#"
259259+----------+--------------+
260260| trace_id | timestamp_ms |
261261+----------+--------------+
262262| 1 | 1 |
263263+----------+--------------+
264264 "#
265- . trim ( ) ;
266- assert_eq ! ( actual, expected) ;
265+ ) ;
267266
268267 Ok ( ( ) )
269268 }
@@ -280,15 +279,14 @@ mod tests {
280279 let cols = agg. emit ( ) ?;
281280 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
282281 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
283- let expected = r#"
282+ assert_snapshot ! ( actual , @ r#"
284283+----------+--------------+
285284| trace_id | timestamp_ms |
286285+----------+--------------+
287286| 1 | 2 |
288287+----------+--------------+
289288 "#
290- . trim ( ) ;
291- assert_eq ! ( actual, expected) ;
289+ ) ;
292290
293291 Ok ( ( ) )
294292 }
@@ -305,15 +303,14 @@ mod tests {
305303 let cols = agg. emit ( ) ?;
306304 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
307305 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
308- let expected = r#"
306+ assert_snapshot ! ( actual , @ r#"
309307+----------+--------------+
310308| trace_id | timestamp_ms |
311309+----------+--------------+
312310| 1 | 1 |
313311+----------+--------------+
314312 "#
315- . trim ( ) ;
316- assert_eq ! ( actual, expected) ;
313+ ) ;
317314
318315 Ok ( ( ) )
319316 }
@@ -330,15 +327,14 @@ mod tests {
330327 let cols = agg. emit ( ) ?;
331328 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
332329 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
333- let expected = r#"
330+ assert_snapshot ! ( actual , @ r#"
334331+----------+--------------+
335332| trace_id | timestamp_ms |
336333+----------+--------------+
337334| 2 | 2 |
338335+----------+--------------+
339336 "#
340- . trim ( ) ;
341- assert_eq ! ( actual, expected) ;
337+ ) ;
342338
343339 Ok ( ( ) )
344340 }
@@ -355,15 +351,14 @@ mod tests {
355351 let cols = agg. emit ( ) ?;
356352 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
357353 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
358- let expected = r#"
354+ assert_snapshot ! ( actual , @ r#"
359355+----------+--------------+
360356| trace_id | timestamp_ms |
361357+----------+--------------+
362358| 1 | 1 |
363359+----------+--------------+
364360 "#
365- . trim ( ) ;
366- assert_eq ! ( actual, expected) ;
361+ ) ;
367362
368363 Ok ( ( ) )
369364 }
@@ -380,15 +375,14 @@ mod tests {
380375 let cols = agg. emit ( ) ?;
381376 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
382377 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
383- let expected = r#"
378+ assert_snapshot ! ( actual , @ r#"
384379+----------+--------------+
385380| trace_id | timestamp_ms |
386381+----------+--------------+
387382| 1 | 2 |
388383+----------+--------------+
389384 "#
390- . trim ( ) ;
391- assert_eq ! ( actual, expected) ;
385+ ) ;
392386
393387 Ok ( ( ) )
394388 }
@@ -406,16 +400,15 @@ mod tests {
406400 let cols = agg. emit ( ) ?;
407401 let batch = RecordBatch :: try_new ( test_schema ( ) , cols) ?;
408402 let actual = format ! ( "{}" , pretty_format_batches( & [ batch] ) ?) ;
409- let expected = r#"
403+ assert_snapshot ! ( actual , @ r#"
410404+----------+--------------+
411405| trace_id | timestamp_ms |
412406+----------+--------------+
413407| | 3 |
414408| 1 | 1 |
415409+----------+--------------+
416410 "#
417- . trim ( ) ;
418- assert_eq ! ( actual, expected) ;
411+ ) ;
419412
420413 Ok ( ( ) )
421414 }
0 commit comments