|
Lines 113-118
Link Here
|
| 113 |
shell.dispose(); |
113 |
shell.dispose(); |
| 114 |
} |
114 |
} |
| 115 |
|
115 |
|
|
|
116 |
public void testBeginningWithSpecialChars() { |
| 117 |
for (String format : formats) { |
| 118 |
String testString = "First line\n:" + format + " is at the beginning"; |
| 119 |
viewer.setDocument(new Document(testString)); |
| 120 |
Region region = new Region(0, testString.length()); |
| 121 |
IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); |
| 122 |
assertNotNull(links); |
| 123 |
assertEquals(1, links.length); |
| 124 |
assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); |
| 125 |
} |
| 126 |
} |
| 127 |
|
| 128 |
public void testBeginningOfSecondLine() { |
| 129 |
for (String format : formats) { |
| 130 |
String testString = "First line\n" + format + " is at the beginning"; |
| 131 |
viewer.setDocument(new Document(testString)); |
| 132 |
Region region = new Region(0, testString.length()); |
| 133 |
IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); |
| 134 |
assertNotNull(links); |
| 135 |
assertEquals(1, links.length); |
| 136 |
assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); |
| 137 |
} |
| 138 |
} |
| 139 |
|
| 140 |
public void testBeginningOfSecondLineWithisWhitespace() { |
| 141 |
for (String format : formats) { |
| 142 |
String testString = "First line\n \t " + format + " is at the beginning"; |
| 143 |
viewer.setDocument(new Document(testString)); |
| 144 |
Region region = new Region(0, testString.length()); |
| 145 |
IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); |
| 146 |
assertNotNull(links); |
| 147 |
assertEquals(1, links.length); |
| 148 |
assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); |
| 149 |
} |
| 150 |
} |
| 151 |
|
| 116 |
public void testBeginning() { |
152 |
public void testBeginning() { |
| 117 |
for (String format : formats) { |
153 |
for (String format : formats) { |
| 118 |
String testString = format + " is at the beginning"; |
154 |
String testString = format + " is at the beginning"; |