Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-01-15 11:56:58 -0500
committerMarkus Keller2015-01-15 11:56:58 -0500
commita8b5c9d223db683911d633ccb68302fd29adf2c3 (patch)
treedf085db40022831e19a0b984360a80e192d2bb47 /org.eclipse.jface.text.tests
parent6715f597963523a39a579e80fb579953fbe7fe15 (diff)
downloadeclipse.platform.text-a8b5c9d223db683911d633ccb68302fd29adf2c3.tar.gz
eclipse.platform.text-a8b5c9d223db683911d633ccb68302fd29adf2c3.tar.xz
eclipse.platform.text-a8b5c9d223db683911d633ccb68302fd29adf2c3.zip
Bug 457230: HTML2TextReader mangles bold style ranges after <pre>I20150116-1000
fixed test to account for Windows line delimiters
Diffstat (limited to 'org.eclipse.jface.text.tests')
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java
index b38a7fb85..12aef7b69 100644
--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java
@@ -257,12 +257,12 @@ public class HTML2TextReaderTest extends TestCase {
}
public void testStylesWithPre() throws IOException {
- String string= "I am <b>bold</b>.\n<p>\n<pre>One\n\n<b>T</b>hree.</pre>\n<p>\n<b>Author:</b> me.";
- String expected= "I am bold. \nOne\n\nThree. \nAuthor: me.";
+ String string= "I am <b>bold</b>." + LD + "<p>" + LD + "<pre>One" + LD + LD + "<b>T</b>hree.</pre>" + LD + "<p>" + LD + "<b>Author:</b> me.";
+ String expected= "I am bold. " + LD + "One" + LD + LD + "Three. " + LD + "Author: me.";
StyleRange[] ranges= {
new StyleRange(5, 4, null, null, SWT.BOLD),
- new StyleRange(17, 1, null, null, SWT.BOLD),
- new StyleRange(25, 7, null, null, SWT.BOLD)
+ new StyleRange(14 + 3*LD.length(), 1, null, null, SWT.BOLD),
+ new StyleRange(21 + 4*LD.length(), 7, null, null, SWT.BOLD)
};
verify(string, expected, ranges);
}

Back to the top