MCPcopy Create free account
hub / github.com/apache/arrow / TEST_F

Function TEST_F

cpp/src/arrow/extension/json_test.cc:47–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47TEST_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
64TEST_F(TestJsonExtensionType, InvalidUTF8) {
65 for (const auto& storage_type : {utf8(), large_utf8(), utf8_view()}) {

Callers

nothing calls this directly

Calls 13

ExampleJsonFunction · 0.85
jsonFunction · 0.85
RoundtripBatchFunction · 0.85
CompareBatchFunction · 0.85
ArrayFromJSONFunction · 0.85
MakeFunction · 0.70
schemaFunction · 0.50
fieldFunction · 0.50
ValidateUTF8Function · 0.50
ValidateFullMethod · 0.45
columnMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected