@@ -0,0 +1,980 @@
+package hudson;%0A%0Aimport junit.framework.TestCase;%0Aimport hudson.MarkupText.SubText;%0A%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * @author Kohsuke Kawaguchi%0A */%0Apublic class MarkupTextTest extends TestCase %7B%0A    public void test1() %7B%0A        MarkupText t = new MarkupText(%22I fixed issue #155. The rest is trick text: xissue #155 issue #123x%22);%0A        for (SubText st : t.findTokens(pattern))%0A            st.surroundWith(%22%3C$1%3E%22,%22%3C$1%3E%22);%0A%0A        System.out.println(t);%0A        assertEquals(t.toString(),%22I fixed %3C155%3Eissue #155%3C155%3E. The rest is trick text: xissue #155 issue #123x%22);%0A    %7D%0A%0A    public void testBoundary() %7B%0A        MarkupText t = new MarkupText(%22issue #155---issue #123%22);%0A        for (SubText st : t.findTokens(pattern))%0A            st.surroundWith(%22%3C$1%3E%22,%22%3C$1%3E%22);%0A%0A        System.out.println(t);%0A        assertEquals(t.toString(),%22%3C155%3Eissue #155%3C155%3E---%3C123%3Eissue #123%3C123%3E%22);%0A    %7D%0A%0A    private static final Pattern pattern = Pattern.compile(%22issue #(%5B0-9%5D+)%22);%0A%7D%0A

its test code.