1
/*******************************************************************************
2
* Copyright (c) 2004, 2007 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Rational Software - Initial API and implementation
10
* Bryan Wilkinson (QNX)
11
*******************************************************************************/
12
package org.eclipse.cdt.ui.tests.text.contentassist2;
14
import junit.framework.Test;
15
import junit.framework.TestSuite;
20
* Testing Type_Reference, with prefix
21
* Bug#50471 : Wrong completion kind after the "using" keyword
24
public class CompletionTest_TypeRef_Prefix extends CompletionProposalsBaseTest{
26
private final String fileName = "CompletionTestStart25.cpp";
27
private final String fileFullPath ="resources/contentassist/" + fileName;
28
private final String headerFileName = "CompletionTestStart.h";
29
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
30
private final String expectedPrefix = "a";
31
private final String[] expectedResults = {
35
public CompletionTest_TypeRef_Prefix(String name) {
37
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=169860
40
public static Test suite() {
41
TestSuite suite= new TestSuite(CompletionTest_TypeRef_Prefix.class.getName());
42
suite.addTest(new CompletionTest_TypeRef_Prefix("testCompletionProposals"));
47
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
49
protected int getCompletionPosition() {
50
return getBuffer().indexOf("using a ") + 7;
54
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
56
protected String getExpectedPrefix() {
57
return expectedPrefix;
61
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
63
protected String[] getExpectedResultsValues() {
64
return expectedResults;
68
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
70
protected String getFileName() {
75
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
77
protected String getFileFullPath() {
81
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
83
protected String getHeaderFileFullPath() {
84
return headerFileFullPath;
88
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
90
protected String getHeaderFileName() {
91
return headerFileName;