clee704 commented on code in PR #41580:
URL: https://github.com/apache/arrow/pull/41580#discussion_r1685630830


##########
cpp/src/parquet/column_writer_test.cc:
##########
@@ -1705,5 +1719,55 @@ TEST(TestColumnWriter, WriteDataPageV2HeaderNullCount) {
   }
 }
 
+using TestInt32Writer = TestPrimitiveWriter<Int32Type>;
+
+TEST_F(TestInt32Writer, NoWriteKeyValueMetadata) {
+  auto writer = this->BuildWriter();
+  writer->Close();
+  auto key_value_metadata = metadata_key_value_metadata();
+  ASSERT_THAT(key_value_metadata, IsNull());
+}
+
+TEST_F(TestInt32Writer, WriteKeyValueMetadata) {
+  auto writer = this->BuildWriter();
+  writer->AddKeyValueMetadata(KeyValueMetadata::Make({"hello"}, {"world"}));
+  writer->Close();
+  auto key_value_metadata = metadata_key_value_metadata();
+  ASSERT_THAT(key_value_metadata, NotNull());
+  ASSERT_THAT(key_value_metadata->size(), 1);
+  ASSERT_OK_AND_ASSIGN(auto value, key_value_metadata->Get("hello"));
+  ASSERT_THAT(value, "world");

Review Comment:
   I'm against using ASSERT_EQ because the direction is reversed, e.g., 
`ASSERT_EQ(expected, actual)`, `ASSERT_THAT(actual, matcher)`, and it can hurt 
the readability when you have both ASSERT_EQ and ASSERT_THAT in the same code. 
If the readability is a concern, we can write `ASSERT_THAT(actual, 
Eq(expected))`. What do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to