Allow omitting "public" and "test"

This commit is contained in:
Andrey Breslav
2013-10-06 14:56:40 +04:00
parent e85a6fda39
commit c376619790
3 changed files with 15 additions and 12 deletions
@@ -347,6 +347,9 @@
<item name='org.objectweb.asm.tree.MethodNode instructions'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</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)'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
+10 -10
View File
@@ -1,38 +1,38 @@
package org.jetbrains.eval4j.test;
public class TestData {
public static void testReturnVoid() {
class TestData {
static void returnVoid() {
}
public static boolean testReturnBoolean() {
static boolean returnBoolean() {
return true;
}
public static byte testReturnByte() {
static byte returnByte() {
return 2;
}
public static short testReturnShort() {
static short returnShort() {
return 2;
}
public static char testReturnChar() {
static char returnChar() {
return '2';
}
public static int testReturnInt() {
static int returnInt() {
return 2;
}
public static long testReturnLong() {
static long returnLong() {
return 2;
}
public static float testReturnFloat() {
static float returnFloat() {
return 2.0f;
}
public static double testReturnDouble() {
static double returnDouble() {
return 2.0d;
}
}
+2 -2
View File
@@ -36,7 +36,7 @@ fun Class<*>.getInternalName(): String = Type.getType(this).getInternalName()
fun doTest(ownerClass: Class<TestData>, methodNode: MethodNode): TestCase? {
var expected: InterpreterResult? = null
for (method in ownerClass.getMethods()) {
for (method in ownerClass.getDeclaredMethods()) {
if (method.getName() == methodNode.name) {
if ((method.getModifiers() and Modifier.STATIC) == 0) {
println("Skipping instance method: $method")
@@ -74,7 +74,7 @@ fun doTest(ownerClass: Class<TestData>, methodNode: MethodNode): TestCase? {
return null
}
return object : TestCase(methodNode.name) {
return object : TestCase("test" + methodNode.name.capitalize()) {
override fun runTest() {
val value = interpreterLoop(