MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/gandiva/regex_functions_holder_test.cc:774–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772 const char* pattern, int32_t pattern_len, int32_t extract_index, int32_t* out_length);
773
774TEST(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}

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected