mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 13:11:39 +07:00
[Groovy] convert GroovyHighlighting40Test to Java (IDEA-327339)
GitOrigin-RevId: da74b2853a963d2346311a30f18ecd89a9d3b902
This commit is contained in:
committed by
intellij-monorepo-bot
parent
87fa964c41
commit
e08a149b42
+30
-32
@@ -1,40 +1,38 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.groovy.lang.highlighting
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.groovy.lang.highlighting;
|
||||
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import groovy.transform.CompileStatic
|
||||
import org.jetbrains.plugins.groovy.GroovyProjectDescriptors
|
||||
import org.jetbrains.plugins.groovy.LightGroovyTestCase
|
||||
import org.jetbrains.plugins.groovy.codeInspection.confusing.UnnecessaryQualifiedReferenceInspection
|
||||
import org.jetbrains.plugins.groovy.util.HighlightingTest
|
||||
import com.intellij.testFramework.LightProjectDescriptor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.GroovyProjectDescriptors;
|
||||
import org.jetbrains.plugins.groovy.LightGroovyTestCase;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.confusing.UnnecessaryQualifiedReferenceInspection;
|
||||
import org.jetbrains.plugins.groovy.util.HighlightingTest;
|
||||
|
||||
@CompileStatic
|
||||
class GroovyHighlighting40Test extends LightGroovyTestCase implements HighlightingTest {
|
||||
|
||||
final LightProjectDescriptor projectDescriptor = GroovyProjectDescriptors.GROOVY_4_0
|
||||
|
||||
void 'test permits without sealed'() {
|
||||
public class GroovyHighlighting40Test extends LightGroovyTestCase implements HighlightingTest {
|
||||
public void testPermitsWithoutSealed() {
|
||||
myFixture.addClass("""
|
||||
public interface Bar {
|
||||
static void foo() {
|
||||
System.out.println("20");
|
||||
}
|
||||
}
|
||||
""")
|
||||
myFixture.enableInspections(UnnecessaryQualifiedReferenceInspection)
|
||||
highlightingTest '''
|
||||
class A implements Bar {
|
||||
void bar() {
|
||||
Bar.foo()
|
||||
}
|
||||
}
|
||||
'''
|
||||
public interface Bar {
|
||||
static void foo() {
|
||||
System.out.println("20");
|
||||
}
|
||||
}
|
||||
""");
|
||||
myFixture.enableInspections(UnnecessaryQualifiedReferenceInspection.class);
|
||||
highlightingTest("""
|
||||
class A implements Bar {
|
||||
void bar() {
|
||||
Bar.foo()
|
||||
}
|
||||
}
|
||||
""");
|
||||
}
|
||||
|
||||
void 'test var in for loop'() {
|
||||
highlightingTest '''
|
||||
for (var i : []) {}
|
||||
'''
|
||||
public void testVarInForLoop() {
|
||||
highlightingTest("for (var i : []) {}");
|
||||
}
|
||||
|
||||
@Override
|
||||
public final @NotNull LightProjectDescriptor getProjectDescriptor() {
|
||||
return GroovyProjectDescriptors.GROOVY_4_0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user