From 237dbac16def3207c09d903e1f508fe759238e3c Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 13 Nov 2023 19:51:40 +0000 Subject: [PATCH] JAL-4059 fixed a test that is now working as expected due to
. Better calculation of long line with HTML tags. --- src/jalview/gui/JvSwingUtils.java | 3 ++- test/jalview/gui/PopupMenuTest.java | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/JvSwingUtils.java b/src/jalview/gui/JvSwingUtils.java index b6b993e..f0fd3a8 100644 --- a/src/jalview/gui/JvSwingUtils.java +++ b/src/jalview/gui/JvSwingUtils.java @@ -95,7 +95,8 @@ public final class JvSwingUtils { continue; } - maxLengthExceeded = line.length() > 60; + String linetext = line.replaceAll("<[^>]+>", ""); + maxLengthExceeded = linetext.length() > 60; if (sb.length() > 0) { sb.append(br); diff --git a/test/jalview/gui/PopupMenuTest.java b/test/jalview/gui/PopupMenuTest.java index 7636bda..e4c6792 100644 --- a/test/jalview/gui/PopupMenuTest.java +++ b/test/jalview/gui/PopupMenuTest.java @@ -199,9 +199,8 @@ public class PopupMenuTest testee.configureReferenceAnnotationsMenu(menu, seqs); assertTrue(menu.isEnabled()); String s = MessageManager.getString("label.add_annotations_for"); - String expected = "" - + "
" + s - + "
Jmol/secondary structure
PDB/Temp
"; + String expected = "" + s + + "
Jmol/secondary structure
PDB/Temp"; assertEquals(expected, menu.getToolTipText()); } -- 1.7.10.2