JAL-4059 updated test for StringUtils
[jalview.git] / test / jalview / util / StringUtilsTest.java
index dc7ed92..1f8e451 100644 (file)
@@ -131,6 +131,15 @@ public class StringUtilsTest
     assertEquals("[hello\\world, jello'\\world', mello'wo\\'rld']",
             Arrays.toString(StringUtils.separatorListToArray(
                     "hello\\world;jello'\\world';mello'wo\\'rld'", ";")));
+    // this next one checks that an escaped single quote doesn't end a quoted
+    // section so the following separator is treated as part of the quoted text,
+    // not as a separator.
+    assertEquals("[hello\\world, jello'\\world', mello'wo\\'r;ld']",
+            Arrays.toString(StringUtils.separatorListToArray(
+                    "hello\\world;jello'\\world';mello'wo\\'r;ld'", ";")));
+    assertEquals("[hello\\;jello, mello\\;';'w, world]",
+            Arrays.toString(StringUtils.separatorListToArray(
+                    "hello\\;jello;mello\\;';'w;world", ";")));
   }
 
   @Test(groups = { "Functional" })