From 410ef7be11683f0c2d797baa739e35b24fa40c1f Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Tue, 14 Nov 2023 10:38:29 +0000 Subject: [PATCH] JAL-4059 added test for
break --- test/jalview/gui/JvSwingUtilsTest.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java index 07b9738..4bc889b 100644 --- a/test/jalview/gui/JvSwingUtilsTest.java +++ b/test/jalview/gui/JvSwingUtilsTest.java @@ -95,7 +95,7 @@ public class JvSwingUtilsTest assertFalse( ("" + tip + "") .equals(JvSwingUtils.wrapTooltip(true, tip)), - "Text is only wrapped in HTML tags when it should be wrapped over lines"); + "Text is only wrapped in HTML tags when it should be shortened/wrapped over lines"); } /** @@ -106,12 +106,21 @@ public class JvSwingUtilsTest @Test(groups = { "Functional" }) public void testWrapTooltip_multilineShortText() { + //
String tip = "Now is the winter of our discontent
Made glorious summer by this sun of York"; assertEquals(JvSwingUtils.wrapTooltip(false, tip), tip, "Text was not kept the same"); assertEquals(JvSwingUtils.wrapTooltip(true, tip), "" + tip + "", "Text was not simply wrapped in HTML"); + + //
+ tip = "Now is the winter of our discontent
Made glorious summer by this sun of York"; + assertEquals(JvSwingUtils.wrapTooltip(false, tip), tip, + "Text was not kept the same"); + assertEquals(JvSwingUtils.wrapTooltip(true, tip), + "" + tip + "", + "Text was not simply wrapped in HTML"); } /** @@ -121,6 +130,7 @@ public class JvSwingUtilsTest @Test(groups = { "Functional" }) public void testWrapTooltip_longText() { + // 76 characters > 60 String tip = "Now is the winter of our discontent made glorious summer by this sun of York"; String expected = "" + "
" + tip + "
"; -- 1.7.10.2