niyue commented on code in PR #39441:
URL: https://github.com/apache/arrow/pull/39441#discussion_r1443568666


##########
cpp/src/gandiva/regex_functions_holder_test.cc:
##########
@@ -635,4 +635,93 @@ TEST_F(TestExtractHolder, TestErrorWhileBuildingHolder) {
   execution_context_.Reset();
 }
 
+class TestRegexpLikeHolder : public ::testing::Test {
+ protected:
+  ExecutionContext execution_context_;
+};
+
+TEST_F(TestRegexpLikeHolder, TestRegexpLikeUseNonParameter) {
+  EXPECT_OK_AND_ASSIGN(auto regex_like_holder, RegexpLikeHolder::Make("ast", 
false, ""));
+  auto& regex_like = *regex_like_holder;
+  std::string source_string = "fast";
+
+  auto ret =
+      regex_like(source_string.c_str(), 
static_cast<int32_t>(source_string.length()));
+  EXPECT_TRUE(ret);
+
+  source_string = "FAST";
+  ret = regex_like(source_string.c_str(), 
static_cast<int32_t>(source_string.length()));
+  EXPECT_TRUE(!ret);
+}
+
+TEST_F(TestRegexpLikeHolder, TestRegexLikeHolderUseIParameter) {
+  EXPECT_OK_AND_ASSIGN(auto regex_like_holder, RegexpLikeHolder::Make("ast", 
true, "i"));

Review Comment:
   It seems we only have tests covering the `i`/`n`/`m` option, and we could 
add some more tests to cover:
   1) the `c` option seems not covered
   2) it will be great if we could add some tests to cover invalid option input 
as well (non `icmn` option)
   3) I am not sure what will/should happen if both `i` and `c` are specified, 
maybe we could confirm this behavior with a test case



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to