| 452 | } |
| 453 | |
| 454 | TEST(TestRunEndEncodeDecodeNested, VariableSizeList) { |
| 455 | auto value_type = list(int32()); |
| 456 | auto input = ArrayFromJSON(value_type, R"([ |
| 457 | [9], [1, 2], [1, 2], [], [], null, null, [null], [null], [3], [3], [4], [9] |
| 458 | ])"); |
| 459 | input = input->Slice(1, 11); |
| 460 | auto expected_values = |
| 461 | ArrayFromJSON(value_type, R"([[1, 2], [], null, [null], [3], [4]])"); |
| 462 | AssertNestedRunEndEncodeDecode(input, "[2, 4, 6, 8, 10, 11]", expected_values); |
| 463 | |
| 464 | AssertNestedRunEndEncodeDecode(ArrayFromJSON(value_type, "[]"), "[]", |
| 465 | ArrayFromJSON(value_type, "[]")); |
| 466 | |
| 467 | auto signed_zeros = ArrayFromJSON(list(float64()), "[[0.0], [-0.0]]"); |
| 468 | AssertNestedRunEndEncodeDecode(signed_zeros, "[1, 2]", signed_zeros); |
| 469 | |
| 470 | auto null_lists = ArrayFromJSON(list(null()), "[[null], [null], [], [null]]"); |
| 471 | auto expected_null_lists = ArrayFromJSON(list(null()), "[[null], [], [null]]"); |
| 472 | AssertNestedRunEndEncodeDecode(null_lists, "[2, 3, 4]", expected_null_lists); |
| 473 | |
| 474 | auto nested_value_type = list(list(int32())); |
| 475 | auto nested_lists = |
| 476 | ArrayFromJSON(nested_value_type, "[[[1], [2]], [[1], [2]], [], null, [[3, null]]]"); |
| 477 | auto expected_nested_lists = |
| 478 | ArrayFromJSON(nested_value_type, "[[[1], [2]], [], null, [[3, null]]]"); |
| 479 | AssertNestedRunEndEncodeDecode(nested_lists, "[2, 3, 4, 5]", expected_nested_lists); |
| 480 | } |
| 481 | |
| 482 | TEST(TestRunEndEncodeDecodeNested, LargeList) { |
| 483 | auto value_type = large_list(int32()); |
nothing calls this directly
no test coverage detected