From 372f32c97b869ab7696eb582865d9cfde112e09e Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 3 Sep 2008 19:24:16 +0000 Subject: [PATCH] added one more test case git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11990 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/test/java/hudson/MarkupTextTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/test/java/hudson/MarkupTextTest.java b/core/src/test/java/hudson/MarkupTextTest.java index d69a48d51f..93897833de 100644 --- a/core/src/test/java/hudson/MarkupTextTest.java +++ b/core/src/test/java/hudson/MarkupTextTest.java @@ -5,6 +5,8 @@ import hudson.MarkupText.SubText; import java.util.List; import java.util.regex.Pattern; +import java.net.URL; +import java.net.MalformedURLException; /** * @author Kohsuke Kawaguchi @@ -37,5 +39,13 @@ public class MarkupTextTest extends TestCase { assertEquals("Fixed 2 issues in this commit, fixing issue <155>155<155>, <145>145<145>", t.toString()); } + public void testLiteralTextSurround() { + MarkupText text = new MarkupText("AAA test AAA"); + for(SubText token : text.findTokens(Pattern.compile("AAA"))) { + token.surroundWithLiteral("$9","$9"); + } + assertEquals("$9AAA$9 test $9AAA$9",text.toString()); + } + private static final Pattern pattern = Pattern.compile("issue #([0-9]+)"); }