changeset 65:195a49887564

Generalize test for table builder output size. When using compression the actually written size might change depending on the current dependencies. The test now checks that any data has been written at all and that the value returned by finish() matches the actual size of the data buffer.
author Thomas Krause <krauseto@hu-berlin.de>
date Sun, 16 Feb 2020 11:52:47 +0100
parents d390b4e31b84
children 8ff0ebc7f63e
files src/table_builder.rs
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/table_builder.rs	Mon Feb 17 10:24:33 2020 +0100
+++ b/src/table_builder.rs	Sun Feb 16 11:52:47 2020 +0100
@@ -309,7 +309,10 @@
         assert!(b.filter_block.is_some());
 
         let actual = b.finish().unwrap();
-        assert_eq!(223, actual);
+        // Ensure that something has been written
+        assert!(!d.is_empty());
+        // The returned length should be the same as the data size
+        assert_eq!(d.len(), actual);
     }
 
     #[test]