Skip to content

Commit 703fcba

Browse files
committed
check display metadata
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent 81e63f8 commit 703fcba

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

vortex-btrblocks/src/string.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ mod tests {
454454
use vortex_array::arrays::VarBinViewArray;
455455
use vortex_array::builders::ArrayBuilder;
456456
use vortex_array::builders::VarBinViewBuilder;
457+
use vortex_array::display::DisplayOptions;
457458
use vortex_dtype::DType;
458459
use vortex_dtype::Nullability;
459460
use vortex_error::VortexResult;
@@ -473,11 +474,14 @@ mod tests {
473474
}
474475
let strings = VarBinViewArray::from_iter(strings, DType::Utf8(Nullability::NonNullable));
475476

476-
println!("original array: {}", strings.as_ref().display_tree());
477-
478477
let compressed = StringCompressor::compress(&strings, false, 3, &[])?;
478+
assert_eq!(compressed.len(), 2048);
479479

480-
println!("compression tree: {}", compressed.display_tree());
480+
let display = compressed
481+
.display_as(DisplayOptions::MetadataOnly)
482+
.to_string()
483+
.to_lowercase();
484+
assert_eq!(display, "vortex.dict(utf8, len=2048)");
481485

482486
Ok(())
483487
}
@@ -492,9 +496,14 @@ mod tests {
492496
let strings = strings.finish_into_varbinview();
493497

494498
let compressed = StringCompressor::compress(&strings, false, MAX_CASCADE, &[])?;
495-
// Verify the compressed array preserves the length.
496499
assert_eq!(compressed.len(), 100);
497500

501+
let display = compressed
502+
.display_as(DisplayOptions::MetadataOnly)
503+
.to_string()
504+
.to_lowercase();
505+
assert_eq!(display, "vortex.varbinview(utf8?, len=100)");
506+
498507
Ok(())
499508
}
500509
}

0 commit comments

Comments
 (0)