Skip to content

Commit 8082d31

Browse files
fangchenliclaude
andcommitted
GH-50478: [C++][Compute] Add utf8_view ignore_case test guarding UTF-8/Latin1 distinction
Add a match_substring ignore_case=true case on utf8_view with non-ASCII input (uppercase E-acute) mirroring the existing MatchSubstringIgnoreCase coverage. utf8_view is registered as StringViewType rather than the generic BinaryViewType dispatch, so case folding spans the full Unicode range; this test fails if that distinction is ever lost. Requested in review by zanmato1984. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 764dff6 commit 8082d31

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

cpp/src/arrow/compute/kernels/scalar_string_test.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,16 @@ TEST(TestStringViewPredicates, MatchLike) {
27692769
"[true, true, null, false, false]", &prefix);
27702770
}
27712771
}
2772+
2773+
// utf8_view registers as StringViewType, so ignore_case folds the full Unicode
2774+
// range (É matches é), not just ASCII. This would fail if utf8_view were
2775+
// dispatched through the generic BinaryViewType path and lost that distinction.
2776+
TEST(TestStringViewPredicates, MatchSubstringIgnoreCase) {
2777+
MatchSubstringOptions options{"aé(", /*ignore_case=*/true};
2778+
CheckScalarUnary("match_substring", utf8_view(),
2779+
R"(["abc", "aEb", "baÉ(", "aé(", "ae(", "Aé("])", boolean(),
2780+
"[false, false, true, true, false, true]", &options);
2781+
}
27722782
#endif
27732783

27742784
TEST(TestStringViewPredicates, Utf8Length) {

0 commit comments

Comments
 (0)