Add test for uncovered case.
This commit is contained in:
@@ -19,6 +19,10 @@ fun print(s : Any?) {}
|
||||
library("parseInt")
|
||||
fun parseInt(s : String) : Int = js.noImpl
|
||||
library
|
||||
fun safeParseInt(s : String) : Int? = js.noImpl
|
||||
library
|
||||
fun safeParseDouble(s : String) : Double? = js.noImpl
|
||||
library
|
||||
open class Exception() : Throwable() {}
|
||||
library
|
||||
class NumberFormatException() : Exception() {}
|
||||
|
||||
@@ -113,4 +113,8 @@ public final class MiscTest extends AbstractExpressionTest {
|
||||
public void testTemporaryVariableCreatedInNamespaceInitializer() throws Exception {
|
||||
checkFooBoxIsTrue("temporaryVariableCreatedInNamespaceInitializer.kt");
|
||||
}
|
||||
|
||||
public void testWhenReturnedWithoutBlock() throws Exception {
|
||||
checkFooBoxIsTrue("whenReturnedWithoutBlock.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package foo
|
||||
|
||||
fun box() : Boolean {
|
||||
if (t(1) != 0) {
|
||||
return false
|
||||
}
|
||||
if (t(0) != 1) {
|
||||
return false
|
||||
}
|
||||
return (t(100) == 2)
|
||||
|
||||
}
|
||||
|
||||
fun t(i : Int) = when(i) {
|
||||
0 -> 1
|
||||
1 -> 0
|
||||
else -> 2
|
||||
}
|
||||
Reference in New Issue
Block a user