generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: groundwork for inspection tests (#30)
- Loading branch information
Showing
5 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.idea | ||
.qodana | ||
build | ||
.testSdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
rootProject.name = "HandleHints" | ||
|
||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0") | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/kotlin/de/sirywell/methodhandleplugin/mhtype/MethodHandleInspectionsTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.sirywell.methodhandleplugin.mhtype | ||
|
||
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase | ||
import de.sirywell.methodhandleplugin.inspection.MethodHandleCreationInspection | ||
|
||
class MethodHandleInspectionsTest : LightJavaCodeInsightFixtureTestCase() { | ||
|
||
private fun doTest() { | ||
projectDescriptor.sdk | ||
myFixture.enableInspections(MethodHandleCreationInspection()) | ||
myFixture.testHighlighting(true, false, true, getTestName(false) + ".java") | ||
} | ||
|
||
override fun getProjectDescriptor() = JAVA_LATEST_WITH_LATEST_JDK | ||
|
||
override fun getTestDataPath(): String { | ||
return "src/test/testData/" | ||
} | ||
|
||
fun testVoidInIdentity() = doTest() | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import java.lang.invoke.MethodHandle; | ||
import java.lang.invoke.MethodHandles; | ||
|
||
class VoidInIdentity { | ||
private static final MethodHandle A = MethodHandles.identity(<warning descr="Parameter must not be of type void.">void.class</warning>); | ||
} |