Remove codegen tests out of JetNpeTest
This commit is contained in:
@@ -0,0 +1 @@
|
||||
fun box() = if (10!! == 10) "OK" else "fail"
|
||||
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
try {
|
||||
if ((null : Int?)!! == 10) return "Fail #1"
|
||||
return "Fail #2"
|
||||
}
|
||||
catch (e: Exception) {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
@@ -449,4 +449,12 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
public void testKt3078() {
|
||||
blackBoxFile("regressions/kt3078.kt");
|
||||
}
|
||||
|
||||
public void testIntLiteralIsNotNull() {
|
||||
blackBoxFile("primitiveTypes/intLiteralIsNotNull.kt");
|
||||
}
|
||||
|
||||
public void testNullAsNullableIntIsNull() {
|
||||
blackBoxFile("primitiveTypes/nullAsNullableIntIsNull.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,20 +16,15 @@
|
||||
|
||||
package org.jetbrains.jet.runtime;
|
||||
|
||||
import com.intellij.testFramework.UsefulTestCase;
|
||||
import jet.runtime.Intrinsics;
|
||||
import org.jetbrains.jet.codegen.CodegenTestCase;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class JetNpeTest extends CodegenTestCase {
|
||||
public class JetNpeTest extends UsefulTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
createEnvironmentWithMockJdkAndIdeaAnnotations();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void testStackTrace () {
|
||||
try {
|
||||
Intrinsics.throwNpe();
|
||||
@@ -41,16 +36,4 @@ public class JetNpeTest extends CodegenTestCase {
|
||||
assertEquals(stackTraceElement.getClassName(), "org.jetbrains.jet.runtime.JetNpeTest");
|
||||
}
|
||||
}
|
||||
|
||||
public void testNotNull () throws Exception {
|
||||
loadText("fun box() = if(10!! == 10) \"OK\" else \"fail\"");
|
||||
blackBox();
|
||||
}
|
||||
|
||||
public void testNull () throws Exception {
|
||||
loadText("fun box() = if((null : Int?)!! == 10) \"OK\" else \"fail\"");
|
||||
// System.out.println(generateToText());
|
||||
Method box = generateFunction("box");
|
||||
assertThrows(box, NullPointerException.class, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user