[groovy] fix testdata: rename classes to differ from file names if the file is a script

GitOrigin-RevId: 37e48f2fcafb2bd0dceb4025a9f1902e085f2507
This commit is contained in:
Daniil Ovchinnikov
2020-01-30 19:06:53 +00:00
committed by intellij-monorepo-bot
parent ec8f71f90e
commit fda1a479b5
10 changed files with 23 additions and 24 deletions
@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.groovy.lang.resolve
import com.intellij.openapi.util.text.StringUtil
@@ -47,7 +47,7 @@ abstract class GroovyResolveTestCase extends LightGroovyTestCase {
fileText = fileText.substring(0, offset) + fileText.substring(offset + MARKER.length())
if (newFilePath == null) {
myFixture.configureByText("aaa." + vFile.extension, fileText)
myFixture.configureByText(vFile.getName(), fileText)
}
else {
myFixture.configureByText(newFilePath, fileText)
@@ -1,4 +1,4 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.groovy.lang.resolve
import com.intellij.openapi.util.RecursionManager
@@ -118,7 +118,7 @@ class TypeInferenceTest extends TypeInferenceTestBase {
void testGenericWildcard() {
final GrReferenceExpression ref = (GrReferenceExpression)configureByFile("genericWildcard/A.groovy").element
assertEquals("A<Base>", ref.type.canonicalText)
assertEquals("X<Base>", ref.type.canonicalText)
}
void testArrayLikeAccessWithIntSequence() {
@@ -1,12 +1,11 @@
class A<E> {}
class X<E> {}
interface Base {}
interface I1 extends Base {}
interface I2 extends Base {}
def <E> A<E> or(A<? extends E>... e) {return null}
def a1 = new A<I1>()
def a2 = new A<I2>()
o<ref>r(a1, a2)
def <E> X<E> or(X<? extends E>... e) {return null}
def x1 = new X<I1>()
def x2 = new X<I2>()
o<ref>r(x1, x2)
@@ -1,8 +1,8 @@
class A {
class X {
def next() {2}
}
def aa = new A()
def aa = new X()
aa++
print a<ref>a
@@ -1,5 +1,5 @@
class A {
class X {
def f1
}
print new A().ge<ref>tF1()
print new X().ge<ref>tF1()
@@ -1,4 +1,4 @@
class A {
class X {
int j
def r() {
@@ -6,4 +6,4 @@ class A {
}
}
int r = new A().<ref>j
int r = new X().<ref>j
@@ -1,4 +1,4 @@
class A {
class X {
int j
def r() {
@@ -7,4 +7,4 @@ class A {
}
new A().<ref>j=10
new X().<ref>j=10
@@ -1,5 +1,5 @@
class A {
class X {
public nonFinal = 4
}
print A.n<ref>onFinal
print X.n<ref>onFinal
+2 -2
View File
@@ -1,4 +1,4 @@
class A {
class X {
int property
int getProperty() {
@@ -6,6 +6,6 @@ class A {
}
}
def a = new A()
def a = new X()
def p = a.<ref>property
+2 -2
View File
@@ -1,4 +1,4 @@
class A {
class X {
int property
int getProperty() {
@@ -10,6 +10,6 @@ class A {
}
}
def a = new A()
def a = new X()
a.<ref>property = 0