From 6574e77aace6228b7e4cddb92c812f9d96c405d3 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 2 Nov 2023 23:07:55 +0000 Subject: [PATCH] JAL-4059 updated test for StringUtils --- test/jalview/util/StringUtilsTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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" }) -- 1.7.10.2