git-hulk commented on code in PR #2873:
URL: https://github.com/apache/kvrocks/pull/2873#discussion_r2036524150


##########
tests/cppunit/string_util_test.cc:
##########
@@ -268,3 +268,41 @@ TEST(StringUtil, RegexMatchExtractSSTFile) {
     ASSERT_TRUE(match_results[1] == "/000038.sst");
   }
 }
+
+TEST(StringUtil, SplitArguments) {
+  std::map<std::string, std::vector<std::string>> valid_cases = {
+      // normal cases
+      {"a b c", {"a", "b", "c"}},
+      {"a\tb\nc\fd", {"a", "b", "c", "d"}},
+
+      //  quote cases
+      {"hello \"a b\" c", {"hello", "a b", "c"}},
+      {"'a b' c", {"a b", "c"}},
+
+      {"\"a\\\"b\" c", {"a\"b", "c"}},
+      {"'a\\' b' c", {"a' b", "c"}},

Review Comment:
   @PragmaTwice Thanks for your tips. Will use the raw string to make it more 
clear.



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