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


##########
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"));
+
+  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);
+}

Review Comment:
   Nit: we could use a new line to separate two test cases for better 
readability



-- 
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