fgerlits commented on code in PR #1753:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1753#discussion_r1560978544


##########
libminifi/test/unit/StringUtilsTests.cpp:
##########
@@ -615,6 +615,16 @@ TEST_CASE("string::parseCharacter tests") {
   CHECK(string::parseCharacter("") == std::nullopt);
 }
 
+TEST_CASE("string::replaceEscapedCharacters tests") {
+  CHECK(string::replaceEscapedCharacters("a") == "a");
+  CHECK(string::replaceEscapedCharacters(R"(\n)") == "\n");
+  CHECK(string::replaceEscapedCharacters(R"(\t)") == "\t");
+  CHECK(string::replaceEscapedCharacters(R"(\r)") == "\r");
+  CHECK(string::replaceEscapedCharacters(R"(\\s)") == "\\\\s");

Review Comment:
   I would add
   ```
   CHECK(string::replaceEscapedCharacters(R"(\s)") == "\\s");
   ```
   (or
   ```
   CHECK(string::replaceEscapedCharacters(R"(\s)") == "s");
   ```
   if we decide to change it)
   
   I would also add the test case
   ```
   CHECK(string::replaceEscapedCharacters(R"(\\ foo \)") == "\\\\ foo \\");
   ```
   (or
   ```
   CHECK(string::replaceEscapedCharacters(R"(\\ foo \)") == "\\ foo \\");
   ```
   if we decide to copy the behavior of `parseCharacter`)



-- 
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-unsubscr...@nifi.apache.org

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

Reply via email to