mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-15 13:02:19 +00:00
added one more test case
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11990 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
df80fc38f4
commit
372f32c97b
1 file changed
+10
@@ -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]+)");
|
||||
}
|
||||
Reference in new issue
Block a user