提交 372f32c9 编写于 作者: K kohsuke

added one more test case

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11990 71c3de6d-444a-0410-be80-ed276b4c234a
上级 df80fc38
......@@ -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]+)");
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册