Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2012-01-11 13:59:03 +0000
committerDani Megert2012-01-11 13:59:03 +0000
commitffc8144b38d604904081eaba5ed19ab3065646f3 (patch)
treefe7ac83bc190b569feb8e8f23ec497eff56c22d2 /org.eclipse.jface.text.tests/src/org
parent8c2cb21c418afbdf3849e3a0c31b0b67aab853cf (diff)
downloadeclipse.platform.text-ffc8144b38d604904081eaba5ed19ab3065646f3.tar.gz
eclipse.platform.text-ffc8144b38d604904081eaba5ed19ab3065646f3.tar.xz
eclipse.platform.text-ffc8144b38d604904081eaba5ed19ab3065646f3.zip
Fixed bug 368219: PatternRule does not always honor fBreaksOnEOFv20120111-1359
Diffstat (limited to 'org.eclipse.jface.text.tests/src/org')
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/rules/FastPartitionerTest.java39
1 files changed, 37 insertions, 2 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 ac695778e17..f48bf80c12f 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, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 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
@@ -8,7 +8,6 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-
package org.eclipse.jface.text.tests.rules;
import junit.framework.TestCase;
@@ -219,6 +218,42 @@ public class FastPartitionerTest extends TestCase {
}
+ public void testBug368219_1() throws Exception {
+ fPartitioner.disconnect();
+ IPartitionTokenScanner scanner= new RuleBasedPartitionScanner() {
+ {
+ IToken comment= new Token(COMMENT);
+ IPredicateRule[] rules= new IPredicateRule[] { new MultiLineRule("/*", "*/", comment) };
+ setPredicateRules(rules);
+ }
+ };
+ fPartitioner= createPartitioner(scanner);
+ fDoc.setDocumentPartitioner(fPartitioner);
+ fPartitioner.connect(fDoc);
+
+ fDoc.set("/**");
+ assertEqualPartition(0, 3, DEFAULT);
+
+ }
+
+ public void testBug368219_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("/**");
+ assertEqualPartition(0, 3, COMMENT);
+
+ }
+
private void assertComputePartitioning_InterleavingPartitions(int[] offsets) {
assertComputePartitioning_InterleavingPartitions(0, fDoc.getLength(), offsets, DEFAULT);
}

Back to the top