| 772 | const char* pattern, int32_t pattern_len, int32_t extract_index, int32_t* out_length); |
| 773 | |
| 774 | TEST(TestRegexpExtractStub, TestIndexStub) { |
| 775 | gandiva::ExecutionContext ctx; |
| 776 | auto ctx_ptr = reinterpret_cast<int64_t>(&ctx); |
| 777 | |
| 778 | EXPECT_OK_AND_ASSIGN(auto holder, gandiva::ExtractHolder::Make(R"((\w+) (\w+))")); |
| 779 | auto holder_ptr = reinterpret_cast<int64_t>(holder.get()); |
| 780 | |
| 781 | std::string pattern = R"((\w+) (\w+))"; |
| 782 | int32_t out_length = 0; |
| 783 | |
| 784 | std::string input = "John Doe"; |
| 785 | const char* ret = gdv_fn_regexp_extract_utf8_utf8_int32( |
| 786 | ctx_ptr, holder_ptr, input.c_str(), static_cast<int32_t>(input.size()), |
| 787 | pattern.c_str(), static_cast<int32_t>(pattern.size()), 2, &out_length); |
| 788 | EXPECT_EQ(std::string(ret, out_length), "Doe"); |
| 789 | } |
nothing calls this directly
no test coverage detected