Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2013-06-20 09:16:49 -0400
committerDani Megert2013-06-20 09:16:49 -0400
commite2a64527973722b66e2f1392f1ee360104d343a6 (patch)
tree94e7cb9e74f8b529b55e68e11c98dac5b9ed6d1b /org.eclipse.jface.text.tests
parent7ea1061c223fdf21b84d633521628d8c7f4b0d71 (diff)
downloadeclipse.platform.text-e2a64527973722b66e2f1392f1ee360104d343a6.tar.gz
eclipse.platform.text-e2a64527973722b66e2f1392f1ee360104d343a6.tar.xz
eclipse.platform.text-e2a64527973722b66e2f1392f1ee360104d343a6.zip
Fixed bug 409538: org.eclipse.jface.text.rules.MultiLineRule EOF matching behavior changed
Diffstat (limited to 'org.eclipse.jface.text.tests')
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/rules/FastPartitionerTest.java38
1 files changed, 37 insertions, 1 deletions
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/rules/FastPartitionerTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/rules/FastPartitionerTest.java
index f48bf80c1..e0eca1be4 100644
--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/rules/FastPartitionerTest.java
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/rules/FastPartitionerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -254,6 +254,42 @@ public class FastPartitionerTest extends TestCase {
}
+ public void testBug409538_1() throws Exception {
+ fPartitioner.disconnect();
+ IPartitionTokenScanner scanner= new RuleBasedPartitionScanner() {
+ {
+ IToken comment= new Token(COMMENT);
+ IPredicateRule[] rules= new IPredicateRule[] { new MultiLineRule("<!--", "-->", comment, (char)0, true) };
+ setPredicateRules(rules);
+ }
+ };
+ fPartitioner= createPartitioner(scanner);
+ fDoc.setDocumentPartitioner(fPartitioner);
+ fPartitioner.connect(fDoc);
+
+ fDoc.set("<");
+ assertEqualPartition(0, 1, DEFAULT);
+
+ }
+
+ public void testBug409538_2() throws Exception {
+ fPartitioner.disconnect();
+ IPartitionTokenScanner scanner= new RuleBasedPartitionScanner() {
+ {
+ IToken comment= new Token(COMMENT);
+ IPredicateRule[] rules= new IPredicateRule[] { new MultiLineRule("<!--", "-->", comment, (char)0, true) };
+ setPredicateRules(rules);
+ }
+ };
+ fPartitioner= createPartitioner(scanner);
+ fDoc.setDocumentPartitioner(fPartitioner);
+ fPartitioner.connect(fDoc);
+
+ fDoc.set("<!-- blah");
+ assertEqualPartition(0, 9, COMMENT);
+
+ }
+
private void assertComputePartitioning_InterleavingPartitions(int[] offsets) {
assertComputePartitioning_InterleavingPartitions(0, fDoc.getLength(), offsets, DEFAULT);
}

Back to the top