Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add tests covering array-specific MethodHandle initializers #39

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ class MethodHandleInspectionsTest : LightJavaCodeInsightFixtureTestCase() {

fun testSimpleIdentity() = doTypeCheckingTest()

fun testInitializeArrayConstructor() = doTypeCheckingTest()

fun testInitializeArrayElementGetter() = doTypeCheckingTest()

fun testInitializeArrayElementSetter() = doTypeCheckingTest()

fun testInitializeArrayLength() = doTypeCheckingTest()

fun testMethodTypeAppendParameterTypes() = doTypeCheckingTest()

fun testMethodTypeChangeParameterType() = doTypeCheckingTest()
Expand Down
6 changes: 6 additions & 0 deletions src/test/testData/InitializeArrayConstructor.java
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 InitializeArrayConstructor {
<info descr="(int)double[]">private static final MethodHandle MH = <info descr="(int)double[]">MethodHandles.arrayConstructor(double[].class)</info>;</info>
}
6 changes: 6 additions & 0 deletions src/test/testData/InitializeArrayElementGetter.java
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 InitializeArrayGetter {
<info descr="(double[],int)double">private static final MethodHandle MH = <info descr="(double[],int)double">MethodHandles.arrayElementGetter(double[].class)</info>;</info>
}
6 changes: 6 additions & 0 deletions src/test/testData/InitializeArrayElementSetter.java
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 InitializeArraySetter {
<info descr="(double[],int,double)void">private static final MethodHandle MH = <info descr="(double[],int,double)void">MethodHandles.arrayElementSetter(double[].class)</info>;</info>
}
6 changes: 6 additions & 0 deletions src/test/testData/InitializeArrayLength.java
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 InitializeArrayLength {
<info descr="(double[])int">private static final MethodHandle MH = <info descr="(double[])int">MethodHandles.arrayLength(double[].class)</info>;</info>
}
Loading