Skip to content

Commit

Permalink
Update delimiter tests to use default values for window and `skip_n…
Browse files Browse the repository at this point in the history
…ew_lines` properties.
  • Loading branch information
kevingurney committed Oct 3, 2023
1 parent fd5aaf2 commit 6fe19f3
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions cpp/src/arrow/pretty_print_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,7 @@ TEST_F(TestPrettyPrint, ChunkedArrayPrimitiveType) {

TEST_F(TestPrettyPrint, ChunkedArrayPrimitiveTypeCustomArrayElementDelimiter) {
PrettyPrintOptions options{};
// Display array contents on one line.
options.skip_new_lines = true;
// Display maximum of 3 elements at the beginning and at the end of the array
options.window = 3;
// Use a custom array element delimiter of " | ",
// Use a custom array element delimiter of " |",
// rather than the default delimiter (i.e. ",").
options.array_element_delimiter = " | ";

Expand All @@ -1064,16 +1060,38 @@ TEST_F(TestPrettyPrint, ChunkedArrayPrimitiveTypeCustomArrayElementDelimiter) {
{
const ChunkedArray chunked_array(chunk);

static const char* expected = R"expected([[1 | 2 | null | 4 | null]])expected";
static const char* expected = R"expected([
[
1 |
2 |
null |
4 |
null
]
])expected";
CheckStream(chunked_array, options, expected);
}

// ChunkedArray with 2 chunks
{
const ChunkedArray chunked_array({chunk, chunk});

static const char* expected =
R"expected([[1 | 2 | null | 4 | null],[1 | 2 | null | 4 | null]])expected";
static const char* expected = R"expected([
[
1 |
2 |
null |
4 |
null
],
[
1 |
2 |
null |
4 |
null
]
])expected";

CheckStream(chunked_array, options, expected);
}
Expand Down

0 comments on commit 6fe19f3

Please sign in to comment.