Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-09-26 23:29:34 +0000
committerspingel2008-09-26 23:29:34 +0000
commitf3c4ef7fa27040058fa62a83ff6284492f874564 (patch)
tree91c024d797b58e85d9e93696df36cef0c407b7b9 /org.eclipse.mylyn.bugzilla.tests/src/org/eclipse
parentcb4f620d0addf9369904a83a0c1373cf8a4a92de (diff)
downloadorg.eclipse.mylyn.tasks-f3c4ef7fa27040058fa62a83ff6284492f874564.tar.gz
org.eclipse.mylyn.tasks-f3c4ef7fa27040058fa62a83ff6284492f874564.tar.xz
org.eclipse.mylyn.tasks-f3c4ef7fa27040058fa62a83ff6284492f874564.zip
NEW - bug 244442: [api] TaskHyperlinkDetector does not detect hyperlinks correctly for regions of non-zero length
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244442
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests/src/org/eclipse')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java
index 2580edc72..476d02f16 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java
@@ -252,4 +252,18 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase {
assertEquals(((TaskHyperlink) links[0]).getRepository(), repository1);
}
+ public void testMatchMultipleEmptyRegion() {
+ String testString = "bug 123 bug 345";
+ viewer.setDocument(new Document(testString));
+ Region region = new Region(10, 0);
+ viewer.setRepository(repository1);
+ repositoryManager.addRepository(repository1);
+
+ IHyperlink[] links = detector.detectHyperlinks(viewer, region, true);
+ assertNotNull(links);
+ assertEquals(1, links.length);
+ assertTrue(links[0] instanceof TaskHyperlink);
+ assertEquals("345", ((TaskHyperlink) links[0]).getTaskId());
+ }
+
}

Back to the top