From: Ben Soares Date: Thu, 2 Nov 2023 23:07:55 +0000 (+0000) Subject: JAL-4059 updated test for StringUtils X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6574e77aace6228b7e4cddb92c812f9d96c405d3;p=jalview.git JAL-4059 updated test for StringUtils --- diff --git a/test/jalview/util/StringUtilsTest.java b/test/jalview/util/StringUtilsTest.java index dc7ed92..1f8e451 100644 --- a/test/jalview/util/StringUtilsTest.java +++ b/test/jalview/util/StringUtilsTest.java @@ -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" })