Skip to content

Commit a005bde

Browse files
committed
Merge pull request #1833 from eugene-auduchinok/tests_cleanup
Fix tests inheritance
2 parents 545766a + 6a12bf3 commit a005bde

File tree

3 files changed

+38
-18
lines changed

3 files changed

+38
-18
lines changed

tests/com/goide/completion/GoCompletionSdkAwareTest.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,10 @@
1919
import com.intellij.codeInsight.completion.CompletionType;
2020
import com.intellij.codeInsight.lookup.Lookup;
2121
import com.intellij.openapi.vfs.VirtualFile;
22-
import com.intellij.testFramework.LightProjectDescriptor;
2322

2423
import java.io.IOException;
2524

26-
public class GoCompletionSdkAwareTest extends GoCompletionTestBase {
27-
@Override
28-
public void setUp() throws Exception {
29-
super.setUp();
30-
setUpProjectSdk();
31-
}
32-
33-
@Override
34-
protected LightProjectDescriptor getProjectDescriptor() {
35-
return createMockProjectDescriptor();
36-
}
37-
25+
public class GoCompletionSdkAwareTest extends GoCompletionSdkAwareTestBase {
3826
public void testFormatter() {
3927
doTestInclude("package main; import . \"fmt\"; type alias <caret>", "Formatter");
4028
}
@@ -79,15 +67,15 @@ public void testFunctionAutoImport() {
7967
"import \"fmt\"\n" +
8068
"func test(){fmt.Fprintln(<caret>)}", "fmt.Fprintln");
8169
}
82-
70+
8371
public void testVariableAutoImport() {
8472
doCheckResult("package main; \n" +
8573
"func test(){ErrNotSuppor<caret>}",
8674
"package main;\n" +
8775
"import \"net/http\"\n" +
8876
"func test(){http.ErrNotSupported}", "http.ErrNotSupported");
8977
}
90-
78+
9179
public void testConstantAutoImport() {
9280
doCheckResult("package main; \n" +
9381
"func test(){O_RDO<caret>}", "package main;\n" +
@@ -298,14 +286,14 @@ public void testDoNotCompleteExampleFunctions() throws IOException {
298286
myFixture.completeBasic();
299287
myFixture.checkResult("package a; func main() { _ = ExampleF<caret>");
300288
}
301-
289+
302290
public void testCompleteTestBenchmarkExamplesFromNonTestFiles() throws IOException {
303291
myFixture.getTempDirFixture().createFile("pack/pack.go", "package pack; func TestFoo() {} func BenchmarkFoo() {} func ExampleFoo() {}");
304292
myFixture.configureByText("my_test.go", "package a; func main() { _ = Foo<caret>");
305293
myFixture.completeBasic();
306294
assertContainsElements(myFixture.getLookupElementStrings(), "pack.TestFoo", "pack.BenchmarkFoo", "pack.ExampleFoo");
307295
}
308-
296+
309297
public void testDoNotAutoImportWithTheSameImportPath() throws IOException {
310298
myFixture.getTempDirFixture().createFile("pack1/file2.go", "package pack1; func MyFunctionFromSamePath() {}");
311299
myFixture.getTempDirFixture().createFile("pack2/file2.go", "package pack1; func MyFunctionFromOtherPath() {}");
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2013-2015 Sergey Ignatov, Alexander Zolotov, Florin Patan
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.goide.completion;
18+
19+
import com.intellij.testFramework.LightProjectDescriptor;
20+
21+
public abstract class GoCompletionSdkAwareTestBase extends GoCompletionTestBase {
22+
@Override
23+
public void setUp() throws Exception {
24+
super.setUp();
25+
setUpProjectSdk();
26+
}
27+
28+
@Override
29+
protected LightProjectDescriptor getProjectDescriptor() {
30+
return createMockProjectDescriptor();
31+
}
32+
}

tests/com/goide/completion/GoExcludePackagesTest.java renamed to tests/com/goide/completion/GoExcludedPackagesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.goide.project.GoExcludedPathsSettings;
2020
import com.intellij.util.ArrayUtil;
2121

22-
public class GoExcludePackagesTest extends GoCompletionSdkAwareTest {
22+
public class GoExcludedPackagesTest extends GoCompletionSdkAwareTestBase {
2323
@Override
2424
protected void tearDown() throws Exception {
2525
GoExcludedPathsSettings.getInstance(getProject()).setExcludedPackages(ArrayUtil.EMPTY_STRING_ARRAY);

0 commit comments

Comments
 (0)