You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/06/27 12:28:54 UTC

[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1359: MINIFICPP-1870 Replace IgnoreCaptureGroupZero with IncludeCaptureGroupZero

adamdebreceni commented on code in PR #1359:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1359#discussion_r907330259


##########
extensions/standard-processors/tests/unit/ExtractTextTests.cpp:
##########
@@ -162,17 +160,34 @@ TEST_CASE("Test usage of ExtractText in regex mode", "[extracttextRegexTest]") {
     test_file.close();
   }
 
-  plan->runNextProcessor();  // GetFile
-  plan->runNextProcessor();  // ExtractText
-  plan->runNextProcessor();  // LogAttribute
+  SECTION("Do not include capture group 0") {
+    plan->setProperty(maprocessor, org::apache::nifi::minifi::processors::ExtractText::IncludeCaptureGroupZero.getName(), "false");
+
+    testController.runSession(plan);
+
+    std::list<std::string> suffixes = { "", ".0", ".1" };
+    for (const auto& suffix : suffixes) {
+      ss.str("");
+      ss << "key:" << "RegexAttr" << suffix << " value:" << ((suffix == ".1") ? "80" : "130");

Review Comment:
   I see that this is old code, but we could rewrite it like you did with the other section, explicitly listing the expected log lines, I found this pretty hard to read, while the new version is more obvious IMO



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org