Allow omitting "public" and "test"
This commit is contained in:
@@ -347,6 +347,9 @@
|
|||||||
<item name='org.objectweb.asm.tree.MethodNode instructions'>
|
<item name='org.objectweb.asm.tree.MethodNode instructions'>
|
||||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||||
</item>
|
</item>
|
||||||
|
<item name='org.objectweb.asm.tree.MethodNode name'>
|
||||||
|
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||||
|
</item>
|
||||||
<item name='org.objectweb.asm.tree.MethodNode org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String, boolean)'>
|
<item name='org.objectweb.asm.tree.MethodNode org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String, boolean)'>
|
||||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
package org.jetbrains.eval4j.test;
|
package org.jetbrains.eval4j.test;
|
||||||
|
|
||||||
public class TestData {
|
class TestData {
|
||||||
public static void testReturnVoid() {
|
static void returnVoid() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean testReturnBoolean() {
|
static boolean returnBoolean() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte testReturnByte() {
|
static byte returnByte() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static short testReturnShort() {
|
static short returnShort() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static char testReturnChar() {
|
static char returnChar() {
|
||||||
return '2';
|
return '2';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int testReturnInt() {
|
static int returnInt() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long testReturnLong() {
|
static long returnLong() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float testReturnFloat() {
|
static float returnFloat() {
|
||||||
return 2.0f;
|
return 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double testReturnDouble() {
|
static double returnDouble() {
|
||||||
return 2.0d;
|
return 2.0d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ fun Class<*>.getInternalName(): String = Type.getType(this).getInternalName()
|
|||||||
|
|
||||||
fun doTest(ownerClass: Class<TestData>, methodNode: MethodNode): TestCase? {
|
fun doTest(ownerClass: Class<TestData>, methodNode: MethodNode): TestCase? {
|
||||||
var expected: InterpreterResult? = null
|
var expected: InterpreterResult? = null
|
||||||
for (method in ownerClass.getMethods()) {
|
for (method in ownerClass.getDeclaredMethods()) {
|
||||||
if (method.getName() == methodNode.name) {
|
if (method.getName() == methodNode.name) {
|
||||||
if ((method.getModifiers() and Modifier.STATIC) == 0) {
|
if ((method.getModifiers() and Modifier.STATIC) == 0) {
|
||||||
println("Skipping instance method: $method")
|
println("Skipping instance method: $method")
|
||||||
@@ -74,7 +74,7 @@ fun doTest(ownerClass: Class<TestData>, methodNode: MethodNode): TestCase? {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return object : TestCase(methodNode.name) {
|
return object : TestCase("test" + methodNode.name.capitalize()) {
|
||||||
|
|
||||||
override fun runTest() {
|
override fun runTest() {
|
||||||
val value = interpreterLoop(
|
val value = interpreterLoop(
|
||||||
|
|||||||
Reference in New Issue
Block a user