Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2011-02-23 16:08:53 +0000
committerMarkus Schorn2011-02-23 16:08:53 +0000
commitdf420139a37f3fde4162641cec2e8314ac5c149c (patch)
treed79cc2859c0af9d536769a76246b8a3350a1f675 /core/org.eclipse.cdt.ui.tests
parent7b8eb1ed1ada12302321c27bb200fa87b7c43d44 (diff)
downloadorg.eclipse.cdt-df420139a37f3fde4162641cec2e8314ac5c149c.tar.gz
org.eclipse.cdt-df420139a37f3fde4162641cec2e8314ac5c149c.tar.xz
org.eclipse.cdt-df420139a37f3fde4162641cec2e8314ac5c149c.zip
Bug 173458: Camel case based content assist, by Jens Elmenthaler.
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/contentassist2/CompletionTests.java21
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java7
2 files changed, 22 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
index 13fe0f2bbf0..31f1843c2e9 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2011 Wind River Systems, Inc. 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
@@ -11,6 +11,7 @@
* Markus Schorn (Wind River Systems)
* IBM Corporation
* Sergey Prigogin (Google)
+ * Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
*******************************************************************************/
package org.eclipse.cdt.ui.tests.text.contentassist2;
@@ -300,7 +301,7 @@ public class CompletionTests extends AbstractContentAssistTest {
//void f() {gC/*cursor*/
public void testGlobalVariables_GlobalScope() throws Exception {
final String[] expected= {
- "gC1", "gC2"
+ "gC1", "gC2", "gfC1(void)", "gfC2(void)"
};
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
}
@@ -308,7 +309,7 @@ public class CompletionTests extends AbstractContentAssistTest {
//void C1::f() {gC/*cursor*/
public void testGlobalVariables_MethodScope() throws Exception {
final String[] expected= {
- "gC1", "gC2"
+ "gC1", "gC2", "gfC1(void)", "gfC2(void)"
};
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
}
@@ -1353,4 +1354,18 @@ public class CompletionTests extends AbstractContentAssistTest {
final String[] expected= { "BaseMethod(void)" };
assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
}
+
+ // #define fooBar
+ // #define foo_bar
+ // fB/*cursor*/
+ public void testUserMacroSegmentMatch() throws Exception {
+ final String[] expected= { "fooBar", "foo_bar" };
+ assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
+ }
+
+ // __bVA/*cursor*/
+ public void testBuiltinMacroSegmentMatch() throws Exception {
+ final String[] expected= { "__builtin_va_arg(ap, type)" };
+ assertCompletionResults(fCursorOffset, expected, COMPARE_ID_STRINGS);
+ }
} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java
index 456ad0a8e94..d389711fc0f 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2011 Wind River Systems, Inc. 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
@@ -9,6 +9,7 @@
* Anton Leherbauer (Wind River Systems) - initial API and implementation
* Markus Schorn (Wind River Systems)
* IBM Corporation
+ * Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
*******************************************************************************/
package org.eclipse.cdt.ui.tests.text.contentassist2;
@@ -594,7 +595,7 @@ public class CompletionTests_PlainC extends AbstractContentAssistTest {
//void f() {gC/*cursor*/
public void testGlobalVariables_GlobalScope() throws Exception {
final String[] expected= {
- "gC1", "gC2"
+ "gC1", "gC2", "gfC1(void)", "gfC2(void)"
};
assertCompletionResults(expected);
}
@@ -604,7 +605,7 @@ public class CompletionTests_PlainC extends AbstractContentAssistTest {
//void foo() {gC/*cursor*/
public void testGlobalVariables_FunctionScope() throws Exception {
final String[] expected= {
- "gC1", "gC2"
+ "gC1", "gC2", "gfC1(void)", "gfC2(void)"
};
assertCompletionResults(expected);
}

Back to the top