Replaced sure() invocations with '!!' operator in codegen tests.
This commit is contained in:
@@ -320,12 +320,12 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testSureNonnull () throws Exception {
|
||||
loadText("fun box() = 10.sure().toString()");
|
||||
loadText("fun box() = 10!!.toString()");
|
||||
assertFalse(generateToText().contains("IFNONNULL"));
|
||||
}
|
||||
|
||||
public void testSureNullable () throws Exception {
|
||||
loadText("val a : Int? = 10; fun box() = a.sure().toString()");
|
||||
loadText("val a : Int? = 10; fun box() = a!!.toString()");
|
||||
assertTrue(generateToText().contains("IFNONNULL"));
|
||||
}
|
||||
|
||||
|
||||
@@ -43,12 +43,12 @@ public class JetNpeTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testNotNull () throws Exception {
|
||||
loadText("fun box() = if(10.sure() == 10) \"OK\" else \"fail\"");
|
||||
loadText("fun box() = if(10!! == 10) \"OK\" else \"fail\"");
|
||||
blackBox();
|
||||
}
|
||||
|
||||
public void testNull () throws Exception {
|
||||
loadText("fun box() = if((null : Int?).sure() == 10) \"OK\" else \"fail\"");
|
||||
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