Abyss-lord commented on code in PR #8442:
URL: https://github.com/apache/gravitino/pull/8442#discussion_r2323939122
##########
clients/cli/src/test/java/org/apache/gravitino/cli/PropertiesTest.java:
##########
@@ -181,4 +181,28 @@ public void testDuplicateKeysArray() {
assertEquals("value2", result.get("key1"), "Last value should overwrite
previous ones");
assertEquals("value3", result.get("key2"));
}
+
+ @Test
+ public void testDelimiterWithRegexSpecialChar() {
+ Properties properties = new Properties("|", "=");
+ String[] input = {"key1=value1|key2=value2"};
+
+ Map<String, String> result = properties.parse(input);
+
+ assertEquals(2, result.size());
+ assertEquals("value1", result.get("key1"));
+ assertEquals("value2", result.get("key2"));
+ }
+
+ @Test
+ public void testSeparatorWithRegexSpecialChar() {
+ Properties properties = new Properties(",", "|");
+ String[] input = {"key1|value1,key2|value2"};
+
+ Map<String, String> result = properties.parse(input);
+
+ assertEquals(2, result.size());
+ assertEquals("value1", result.get("key1"));
+ assertEquals("value2", result.get("key2"));
+ }
Review Comment:
It would be better if we add some cases for null inputs.
--
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]