Fixed tests after adding error checking for intention tests.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
class Klass<T>
|
||||
|
||||
fun test(obj: Any): String {
|
||||
return <caret>if (obj is String)
|
||||
"string"
|
||||
else if (obj is Int)
|
||||
"int"
|
||||
else if (obj is Class<*>)
|
||||
else if (obj is Klass<*>)
|
||||
"class"
|
||||
else "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
class Klass<T>
|
||||
|
||||
fun test(obj: Any): String {
|
||||
return <caret>when (obj) {
|
||||
return when (obj) {
|
||||
is String -> "string"
|
||||
is Int -> "int"
|
||||
is Class<*> -> "class"
|
||||
is Klass<*> -> "class"
|
||||
else -> "unknown"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun test(n: Int) {
|
||||
val s = "test"
|
||||
fun test(n: Int): String {
|
||||
var s = "test"
|
||||
<caret>if (n == 0)
|
||||
s = "zero"
|
||||
else if (n == 1)
|
||||
@@ -7,4 +7,4 @@ fun test(n: Int) {
|
||||
else if (n == 2)
|
||||
s = "two"
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
fun test(n: Int) {
|
||||
val s = "test"
|
||||
fun test(n: Int): String {
|
||||
var s = "test"
|
||||
when (n) {
|
||||
0 -> s = "zero"
|
||||
1 -> s = "one"
|
||||
2 -> s = "two"
|
||||
}
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class G {
|
||||
object G {
|
||||
fun cat(x: Int, y: Int): Int {
|
||||
return x + y
|
||||
}
|
||||
@@ -10,4 +10,4 @@ fun test(x: Int, y: Int): String {
|
||||
2 -> return "two"
|
||||
else -> return "big"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
class G {
|
||||
object G {
|
||||
fun cat(x: Int, y: Int): Int {
|
||||
return x + y
|
||||
}
|
||||
@@ -8,4 +8,4 @@ fun test(x: Int, y: Int): String {
|
||||
if (G.cat(x, y) == 1) return "one"
|
||||
else if (G.cat(x, y) == 2) return "two"
|
||||
else return "big"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
class Klass<T>
|
||||
|
||||
fun test(obj: Any): String {
|
||||
return <caret>when (obj) {
|
||||
is String -> "string"
|
||||
is Int -> "int"
|
||||
is Class<*> -> "class"
|
||||
is Klass<*> -> "class"
|
||||
else -> "unknown"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
class Klass<T>
|
||||
|
||||
fun test(obj: Any): String {
|
||||
return <caret>if (obj is String) "string"
|
||||
else if (obj is Int) "int"
|
||||
else if (obj is Class<*>) "class"
|
||||
else if (obj is Klass<*>) "class"
|
||||
else "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
fun test(n: Int) {
|
||||
val s = "test"
|
||||
fun test(n: Int): String {
|
||||
var s = "test"
|
||||
<caret>when (n) {
|
||||
0 -> s = "zero"
|
||||
1 -> s = "one"
|
||||
2 -> s = "two"
|
||||
}
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
fun test(n: Int) {
|
||||
val s = "test"
|
||||
fun test(n: Int): String {
|
||||
var s = "test"
|
||||
if (n == 0) s = "zero"
|
||||
else if (n == 1) s = "one"
|
||||
else if (n == 2) s = "two"
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user