@@ -218,6 +218,7 @@ mod tests {
218218 use vortex_array:: arrays:: PrimitiveArray ;
219219 use vortex_array:: builders:: ArrayBuilder ;
220220 use vortex_array:: builders:: VarBinViewBuilder ;
221+ use vortex_array:: serde:: ArrayParts ;
221222 use vortex_array:: validity:: Validity ;
222223 use vortex_buffer:: BitBufferMut ;
223224 use vortex_buffer:: buffer;
@@ -232,6 +233,7 @@ mod tests {
232233 use crate :: IntoLayout ;
233234 use crate :: OwnedLayoutChildren ;
234235 use crate :: layouts:: chunked:: ChunkedLayout ;
236+ use crate :: layouts:: flat:: FlatVTable ;
235237 use crate :: layouts:: flat:: writer:: FlatLayoutStrategy ;
236238 use crate :: layouts:: struct_:: StructLayout ;
237239 use crate :: segments:: TestSegments ;
@@ -413,34 +415,21 @@ vortex.chunked, dtype: i32, children: 2, rows: 10
413415 . await
414416 . unwrap ( ) ;
415417
416- // Downcast to FlatLayout to access the array_tree
417- use vortex_array:: serde:: ArrayParts ;
418-
419- use crate :: layouts:: flat:: FlatVTable ;
420-
421418 let flat_layout = layout. as_ :: < FlatVTable > ( ) ;
422419
423- // Verify that array_tree is populated when FLAT_LAYOUT_INLINE_ARRAY_NODE is set
424420 let array_tree = flat_layout
425421 . array_tree ( )
426422 . expect ( "array_tree should be populated when FLAT_LAYOUT_INLINE_ARRAY_NODE is set" ) ;
427423
428- // Verify from_array_tree works on the inline metadata
429424 let parts = ArrayParts :: from_array_tree ( array_tree. as_ref ( ) . to_vec ( ) )
430425 . expect ( "should parse array_tree" ) ;
431426 assert_eq ! ( parts. buffer_lengths( ) , vec![ 20 ] ) ; // 5 i32 values = 20 bytes
432427
433- // Test display_array_tree exact output
434- let array_tree_display = flat_layout. display_array_tree ( ) ;
435- assert_eq ! (
436- format!( "{}" , array_tree_display) ,
437- "ArrayTree(vortex.primitive, buffers=[20B])"
438- ) ;
439-
440- // Test display_tree exact output
441428 assert_eq ! (
442- format!( "{}" , layout. display_tree( ) ) ,
443- "vortex.flat, dtype: i32?, segment 0, buffers=[20B], total=20B\n "
429+ layout. display_tree( ) . to_string( ) ,
430+ "\
431+ vortex.flat, dtype: i32?, segment 0, buffers=[20B], total=20B
432+ "
444433 ) ;
445434 } )
446435 }
@@ -469,8 +458,10 @@ vortex.chunked, dtype: i32, children: 2, rows: 10
469458
470459 // Test display_tree exact output (with inline array_tree enabled by env var from other test)
471460 assert_eq ! (
472- format!( "{}" , layout. display_tree( ) ) ,
473- "vortex.flat, dtype: i64, segment 0, buffers=[24B], total=24B\n "
461+ layout. display_tree( ) . to_string( ) ,
462+ "\
463+ vortex.flat, dtype: i64, segment 0, buffers=[24B], total=24B
464+ "
474465 ) ;
475466 } )
476467 }
0 commit comments