mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] add tests for 'for' variables
This commit is contained in:
@@ -52,4 +52,38 @@ class ResolveLocalTest implements ResolveTest {
|
||||
void 'parameter from resource initializer'() {
|
||||
resolveTest 'def foo(param) { try (def a = <caret>param) {} }', GrParameter
|
||||
}
|
||||
|
||||
@Test
|
||||
void 'for variable from for block'() {
|
||||
resolveTest 'for (def e;;){ <caret>e }', GrVariable
|
||||
}
|
||||
|
||||
@Test
|
||||
void 'for variable from for condition'() {
|
||||
resolveTest 'for (def e;<caret>e;){}', GrVariable
|
||||
}
|
||||
|
||||
@Test
|
||||
void 'for variable from for update'() {
|
||||
resolveTest 'for (def e;;<caret>e){}', GrVariable
|
||||
}
|
||||
|
||||
@Test
|
||||
void 'for variable from for-each expression'() {
|
||||
resolveTest 'for (e : <caret>e) {}', null
|
||||
resolveTest 'for (e in <caret>e) {}', null
|
||||
}
|
||||
|
||||
@Test
|
||||
void 'for variable from for-each block'() {
|
||||
resolveTest 'for (e : b) { <caret>e }', GrVariable
|
||||
resolveTest 'for (e in b) { <caret>e }', GrVariable
|
||||
}
|
||||
|
||||
@Test
|
||||
void 'for variable after for'() {
|
||||
resolveTest 'for (def e;;) {}; <caret>e', null
|
||||
resolveTest 'for (e : b) {}; <caret>e', null
|
||||
resolveTest 'for (e in b) {}; <caret>e', null
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -58,11 +58,6 @@ class ResolvePropertyTest extends GroovyResolveTestCase {
|
||||
doTest("field2/A.groovy")
|
||||
}
|
||||
|
||||
void testForVariable1() throws Exception {
|
||||
disableTransformations testRootDisposable
|
||||
resolve "ForVariable.groovy", GrParameter
|
||||
}
|
||||
|
||||
void testArrayLength() throws Exception {
|
||||
doTest("arrayLength/A.groovy")
|
||||
}
|
||||
@@ -87,10 +82,6 @@ class ResolvePropertyTest extends GroovyResolveTestCase {
|
||||
assertTrue(ref.resolve() instanceof GrAccessorMethod)
|
||||
}
|
||||
|
||||
void _testForVariable2() throws Exception {
|
||||
doTest("forVariable2/ForVariable.groovy")
|
||||
}
|
||||
|
||||
void testCatchParameter() throws Exception {
|
||||
disableTransformations testRootDisposable
|
||||
resolve "CatchParameter.groovy", GrParameter
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
class ForVariable {
|
||||
def foo = {
|
||||
for (i in is) {
|
||||
def e = <ref>i
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
class ForVariable {
|
||||
def foo = {
|
||||
for (def i = 0, j = 0;;) {
|
||||
def e = <ref>j
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user