Skip to content

Commit 57ec3fd

Browse files
committed
improve the test - check multiple matches
1 parent d620c03 commit 57ec3fd

File tree

1 file changed

+4
-3
lines changed
  • opengrok-indexer/src/test/java/org/opengrok/indexer/web

1 file changed

+4
-3
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/web/UtilTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,13 @@ void testLinkifyPattern() {
485485
*/
486486
@Test
487487
void testLinkifyPatternEscape() {
488-
final String text = "foo bug <123456> bar";
488+
final String text = "foo bug <123456> bar bug 777";
489489
final String expected = "foo bug <a href=\"http://www.example.com?bug=%3C123456%3E\" " +
490-
"rel=\"noreferrer\" target=\"_blank\">&lt;123456&gt;</a> bar";
490+
"rel=\"noreferrer\" target=\"_blank\">&lt;123456&gt;</a> bar " +
491+
"bug <a href=\"http://www.example.com?bug=777\" rel=\"noreferrer\" target=\"_blank\">777</a>";
491492

492493
assertEquals(expected,
493-
Util.linkifyPattern(text, Pattern.compile("[ \\t]+([0-9<>]{3,})[ \\t]+"), "http://www.example.com?bug="));
494+
Util.linkifyPattern(text, Pattern.compile("[ \\t]+([0-9<>]{3,})[ \\t]*"), "http://www.example.com?bug="));
494495
}
495496

496497
@Test

0 commit comments

Comments
 (0)