This is an automated email from the ASF dual-hosted git repository. heneveld pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit f61365a8ef09146e3ed38d1378c4a21c50848724 Author: Alex Heneveld <[email protected]> AuthorDate: Thu Aug 31 10:19:38 2023 +0100 another quoted string test, for bash --- .../org/apache/brooklyn/util/text/QuotedStringTokenizerTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/utils/common/src/test/java/org/apache/brooklyn/util/text/QuotedStringTokenizerTest.java b/utils/common/src/test/java/org/apache/brooklyn/util/text/QuotedStringTokenizerTest.java index aa31e89da7..3f1230a6a9 100644 --- a/utils/common/src/test/java/org/apache/brooklyn/util/text/QuotedStringTokenizerTest.java +++ b/utils/common/src/test/java/org/apache/brooklyn/util/text/QuotedStringTokenizerTest.java @@ -25,6 +25,7 @@ import java.util.LinkedList; import java.util.List; import org.apache.brooklyn.test.Asserts; +import org.apache.brooklyn.util.collections.MutableList; import org.apache.brooklyn.util.exceptions.Exceptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -195,4 +196,12 @@ public class QuotedStringTokenizerTest { //System.out.println("expected="+expected+" quoted="+quoted+" unquoted="+unquoted); assertEquals(unquoted, expected); } + + @Test + public void testBashLike() throws Exception { + Asserts.assertEquals(new QuotedStringTokenizer("This is a test\\ of spaces and \"some in quotes\" too").remainderAsList(), + MutableList.of("This", "is", "a", "test\\", "of", "spaces", "and", "\"some in quotes\"", "too")); + // note: backslashed escapes are not handled at present; ideally it would give us back this: + //MutableList.of("This", "is", "a", "test\\ of", "spaces", "and", "\"some in quotes\"", "too")); + } }
