Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2008-03-10 08:56:51 +0000
committerAnton Leherbauer2008-03-10 08:56:51 +0000
commit12348ba29776be519b2a8fa310331ace4d908014 (patch)
tree269da3906223658f64a2d099c59f0b18e30f1e41 /core/org.eclipse.cdt.ui.tests
parentc9dbba10e84be5443a395b955699d010a417e279 (diff)
downloadorg.eclipse.cdt-12348ba29776be519b2a8fa310331ace4d908014.tar.gz
org.eclipse.cdt-12348ba29776be519b2a8fa310331ace4d908014.tar.xz
org.eclipse.cdt-12348ba29776be519b2a8fa310331ace4d908014.zip
Fix 221853: Assembly editor does not parse comments correctly
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests')
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AsmPartitionerTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AsmPartitionerTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AsmPartitionerTest.java
index c69225bee1d..418450a04be 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AsmPartitionerTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/AsmPartitionerTest.java
@@ -1073,6 +1073,29 @@ public class AsmPartitionerTest extends TestCase {
}
}
+ public void testSingleLineComment_CppStyle() throws BadLocationException {
+ fDocument.set("// single line comment");
+ int p1= fDocument.getLength();
+ ITypedRegion[] result= fDocument.computePartitioning(0, fDocument.getLength());
+ TypedRegion[] expectation= {
+ new TypedRegion(0, p1, ICPartitions.C_SINGLE_LINE_COMMENT)
+ };
+ checkPartitioning(expectation, result);
+
+ fDocument.replace(p1++, 0, "\nlabel: opcode arg1,arg2 ");
+ int p2= fDocument.getLength();
+ fDocument.replace(p2, 0, "// end-of-line comment");
+ int p3= fDocument.getLength();
+
+ result= fDocument.computePartitioning(0, fDocument.getLength());
+ expectation= new TypedRegion[] {
+ new TypedRegion(0, p1, ICPartitions.C_SINGLE_LINE_COMMENT),
+ new TypedRegion(p1, p2-p1, IDocument.DEFAULT_CONTENT_TYPE),
+ new TypedRegion(p2, p3-p2, ICPartitions.C_SINGLE_LINE_COMMENT)
+ };
+ checkPartitioning(expectation, result);
+ }
+
public void testSingleLineComment_Hash() throws BadLocationException {
// to get single line comment partitions for # lines,
// we need to configure the partitioner

Back to the top