Protection against "<caret>" missing in test data

Many incorrect tests fixed
This commit is contained in:
Valentin Kipyatkov
2016-09-21 22:08:19 +03:00
parent be8b31e82b
commit 21c2268f70
29 changed files with 52 additions and 27 deletions
@@ -1,7 +1,7 @@
// IS_APPLICABLE: false
fun main(args: Array<String>) {
val foo: String? = "foo"
if (foo == null) {
<caret>if (foo == null) {
null
}
else {
@@ -2,4 +2,4 @@
fun foo(y: Int, z: Int) = y - z
val x = { second: Int, first: Int -> foo(first, second) }
val x = { second: Int, first: Int -> <caret>foo(first, second) }
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
fun foo(a: Boolean): Boolean {
return !a
return <caret>!a
}
@@ -1,7 +1,7 @@
// IS_APPLICABLE: false
fun foo(p: Boolean): String {
return bar() ?: return "a"
<caret>return bar() ?: return "a"
}
fun bar(): String? = null
@@ -3,7 +3,7 @@
data class XY(val x: Int, val y: Int)
fun test(xys: Array<XY>) {
for (xy in xys) {
for (<caret>xy in xys) {
val x = xy.x
println(x)
val y = xy.y + x
@@ -5,7 +5,7 @@ import java.util.*
fun foo(list: List<String>): String? {
val random = Random()
for (s in list) {
<caret>for (s in list) {
if (random.nextBoolean()) {
return s
}
@@ -1,7 +1,7 @@
// IS_APPLICABLE: false
class Foo {
lateinit var bar: String
<caret>lateinit var bar: String
fun init() {
bar = ""
@@ -2,5 +2,5 @@
// IS_APPLICABLE: false
fun foo(a: Float) {
1f..a - 1
1f<caret>..a - 1
}
+1 -1
View File
@@ -2,7 +2,7 @@
fun <T> doSomething(a: T) {}
fun main(x: Int) {
if (x !in 5..6) {
if (x <caret>!in 5..6) {
doSomething("test")
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
fun <T> doSomething(a: T) {}
fun main(x: Int) {
if (x !is Int) {
if (x <caret>!is Int) {
doSomething("test")
}
}