Add unit test

This commit is contained in:
Micah Kornfield committed 2019-05-18 21:55:47 -07:00
1 parent 9568a67448
commit 25980a37ae
1 file changed
+24
+24
View File
@@ -566,6 +566,16 @@ TEST(TestColumnDescriptor, TestAttrs) {
ASSERT_EQ(Type::BYTE_ARRAY, descr.physical_type());
ASSERT_EQ(-1, descr.type_length());
ASSERT_EQ(
R"(column descriptor = {
name: name
path:
physical_type: BYTE_ARRAY
logical_type: UTF8
max_definition_level: 4
max_repetition_level: 1
})",
descr.ToString());
// Test FIXED_LEN_BYTE_ARRAY
node = PrimitiveNode::Make("name", Repetition::OPTIONAL, Type::FIXED_LEN_BYTE_ARRAY,
@@ -574,6 +584,20 @@ TEST(TestColumnDescriptor, TestAttrs) {
ASSERT_EQ(Type::FIXED_LEN_BYTE_ARRAY, descr.physical_type());
ASSERT_EQ(12, descr.type_length());
ASSERT_EQ(
R"(column descriptor = {
name: name
path:
physical_type: FIXED_LEN_BYTE_ARRAY
logical_type: DECIMAL
max_definition_level: 4
max_repetition_level: 1
length: 12
precision: 10
scale: 4
})",
descr.ToString());
}
class TestSchemaDescriptor : public ::testing::Test {