Add test for nullable primitive in range
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x: Int? = 42
|
||||
val n: Int? = null
|
||||
|
||||
fun box(): String {
|
||||
if (x in 0..2) return "Fail in"
|
||||
if (!(x !in 0..2)) return "Fail !in"
|
||||
|
||||
if (n in 0..2) return "Fail in null"
|
||||
if (!(n !in 0..2)) return "Fail !in null"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -13315,6 +13315,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullableInPrimitiveRange.kt")
|
||||
public void testNullableInPrimitiveRange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rangeContainsString.kt")
|
||||
public void testRangeContainsString() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/rangeContainsString.kt");
|
||||
|
||||
@@ -13315,6 +13315,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullableInPrimitiveRange.kt")
|
||||
public void testNullableInPrimitiveRange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rangeContainsString.kt")
|
||||
public void testRangeContainsString() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/rangeContainsString.kt");
|
||||
|
||||
@@ -13315,6 +13315,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullableInPrimitiveRange.kt")
|
||||
public void testNullableInPrimitiveRange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rangeContainsString.kt")
|
||||
public void testRangeContainsString() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/rangeContainsString.kt");
|
||||
|
||||
@@ -14995,6 +14995,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullableInPrimitiveRange.kt")
|
||||
public void testNullableInPrimitiveRange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("rangeContainsString.kt")
|
||||
public void testRangeContainsString() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ranges/contains/rangeContainsString.kt");
|
||||
|
||||
Reference in New Issue
Block a user