| 45 | } |
| 46 | |
| 47 | TEST_F(TestJsonExtensionType, JsonRoundtrip) { |
| 48 | for (const auto& storage_type : {utf8(), large_utf8(), utf8_view()}) { |
| 49 | std::shared_ptr<Array> ext_arr = ExampleJson(storage_type); |
| 50 | auto batch = |
| 51 | RecordBatch::Make(schema({field("f0", json(storage_type))}), 8, {ext_arr}); |
| 52 | |
| 53 | std::shared_ptr<RecordBatch> read_batch; |
| 54 | ASSERT_OK(RoundtripBatch(batch, &read_batch)); |
| 55 | ASSERT_OK(read_batch->ValidateFull()); |
| 56 | CompareBatch(*batch, *read_batch, /*compare_metadata*/ true); |
| 57 | |
| 58 | auto read_ext_arr = read_batch->column(0); |
| 59 | ASSERT_OK(internal::ValidateUTF8(*read_ext_arr)); |
| 60 | ASSERT_OK(read_ext_arr->ValidateFull()); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | TEST_F(TestJsonExtensionType, InvalidUTF8) { |
| 65 | for (const auto& storage_type : {utf8(), large_utf8(), utf8_view()}) { |
nothing calls this directly
no test coverage detected