From 72d2b7bcf5b8284a1d2420296d836700388e764a Mon Sep 17 00:00:00 2001 From: Rian-Ismael <106334437+Rian-Ismael@users.noreply.github.com> Date: Sat, 8 Feb 2025 11:38:09 -0300 Subject: [PATCH] Split one test into two in MarkupTextTest (#10226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update MarkupTextTest.java Improves the readability of the test. Splitting assertions into separate tests improves clarity and ensures each test verifies a single scenario or state. This enhances readability, maintainability, and debugging efficiency. * Update core/src/test/java/hudson/MarkupTextTest.java Co-authored-by: Kris Stern --------- Co-authored-by: Kris Stern --- core/src/test/java/hudson/MarkupTextTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/hudson/MarkupTextTest.java b/core/src/test/java/hudson/MarkupTextTest.java index 6c3ff369eccc..1b69d0be8d25 100644 --- a/core/src/test/java/hudson/MarkupTextTest.java +++ b/core/src/test/java/hudson/MarkupTextTest.java @@ -81,13 +81,16 @@ public void literalTextSurround() { * Start/end tag nesting should be correct regardless of the order tags are added. */ @Test - public void adjacent() { + public void addMarkupInOrder() { MarkupText text = new MarkupText("abcdef"); text.addMarkup(0, 3, "$", "$"); text.addMarkup(3, 6, "#", "#"); assertEquals("$abc$#def#", text.toString(false)); + } - text = new MarkupText("abcdef"); + @Test + public void addMarkupInReversedOrder() { + MarkupText text = new MarkupText("abcdef"); text.addMarkup(3, 6, "#", "#"); text.addMarkup(0, 3, "$", "$"); assertEquals("$abc$#def#", text.toString(false));