Skip to content

Commit

Permalink
add test for large string (large_utf8())
Browse files Browse the repository at this point in the history
  • Loading branch information
llama90 committed May 25, 2024
1 parent 42af932 commit a59133f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cpp/src/arrow/scalar_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1864,10 +1864,12 @@ class TestUnionScalar : public ::testing::Test {
{union_string_null_, "null"},
{union_number_null_, "null"}};

for (const auto& [scalar, expected] : test_cases) {
ASSERT_OK_AND_ASSIGN(auto casted, Cast(scalar, utf8()));
ASSERT_EQ(casted.scalar()->ToString(), expected)
<< "Failed to cast " << scalar->ToString() << " to " << expected;
for (const auto& out_ty : {utf8(), large_utf8()}) {
for (const auto& [scalar, expected] : test_cases) {
ASSERT_OK_AND_ASSIGN(auto casted, Cast(scalar, out_ty));
ASSERT_EQ(casted.scalar()->ToString(), expected)
<< "Failed to cast " << scalar->ToString() << " to " << expected;
}
}
}

Expand Down

0 comments on commit a59133f

Please sign in to comment.