Fix tests after implementing trailing comma in formatter

#KT-34744
This commit is contained in:
Dmitry Gridin
2020-01-14 20:56:48 +07:00
parent d98794479d
commit d06787886a
112 changed files with 598 additions and 371 deletions
@@ -1,7 +1,9 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
return ""
})
foo(
fun(it: Int): String {
return ""
}
)
}
@@ -1,7 +1,9 @@
fun bar(f: (Int, Int) -> String) {}
fun test() {
bar(fun(i: Int, j: Int): String {
return "$i$j"
})
bar(
fun(i: Int, j: Int): String {
return "$i$j"
}
)
}
@@ -2,7 +2,9 @@ class Foo
fun bar(f: Foo.() -> Unit) {}
fun main(args: Array<String>) {
bar(fun Foo.() {
bar(
fun Foo.() {
})
}
)
}
@@ -2,7 +2,9 @@ class Foo
fun baz(f: Foo.(i: Int, j: Int) -> Int) {}
fun main(args: Array<String>) {
baz(fun Foo.(i: Int, j: Int): Int {
return i + j
})
baz(
fun Foo.(i: Int, j: Int): Int {
return i + j
}
)
}
@@ -6,7 +6,9 @@ import java.util.*
fun foo(f: () -> ArrayDeque<*>) {}
fun test() {
foo(fun(): ArrayDeque<Int> {
return ArrayDeque<Int>()
})
foo(
fun(): ArrayDeque<Int> {
return ArrayDeque<Int>()
}
)
}
@@ -6,7 +6,9 @@ import java.util.*
fun foo(f: () -> ArrayDeque<*>) {}
fun test() {
foo(fun(): ArrayDeque<*> {
return ArrayDeque<Int>()
})
foo(
fun(): ArrayDeque<*> {
return ArrayDeque<Int>()
}
)
}
@@ -1,9 +1,11 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
// comment1
return ""
// comment2
})
foo(
fun(it: Int): String {
// comment1
return ""
// comment2
}
)
}
@@ -1,7 +1,9 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
return "$it"
})
foo(
fun(it: Int): String {
return "$it"
}
)
}
@@ -1,10 +1,12 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
if (it == 1) {
return "1"
}
return "$it"
})
foo(
fun(it: Int): String {
if (it == 1) {
return "1"
}
return "$it"
}
)
}
@@ -1,13 +1,15 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
if (it == 1) {
return "1"
} else if (it == 2) {
return "2"
} else {
return "$it"
}
})
foo(
fun(it: Int): String {
if (it == 1) {
return "1"
} else if (it == 2) {
return "2"
} else {
return "$it"
}
}
)
}
@@ -2,10 +2,12 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
listOf(1).map {
return@map 2
}
return "$it"
})
foo(
fun(it: Int): String {
listOf(1).map {
return@map 2
}
return "$it"
}
)
}
@@ -1,8 +1,10 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
val b = it == 1
return if (b) "1" else "2"
})
foo(
fun(it: Int): String {
val b = it == 1
return if (b) "1" else "2"
}
)
}
@@ -1,7 +1,9 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo(fun(it: Int): String {
return "$it"
})
foo(
fun(it: Int): String {
return "$it"
}
)
}
@@ -1,5 +1,7 @@
fun main() {
Test().foo(fun(it: Int) {
Test().foo(
fun(it: Int) {
})
}
)
}
@@ -3,5 +3,6 @@ fun baz(name: String, f: (Int) -> String) {}
fun test() {
baz(name = "", f = fun(it: Int): String {
return "$it"
})
}
)
}
@@ -1,7 +1,9 @@
fun foo(f: () -> String) {}
fun test() {
foo(fun(): String {
return ""
})
foo(
fun(): String {
return ""
}
)
}
@@ -3,8 +3,10 @@ fun unit(f: (Int) -> Unit) {}
fun foo(i: Int) {}
fun test() {
unit(fun(it: Int) {
foo(it)
foo(it)
})
unit(
fun(it: Int) {
foo(it)
foo(it)
}
)
}
@@ -7,7 +7,9 @@ data class My(val x: Int)
fun foo(f: () -> My) {}
fun test() {
foo(fun(): My {
return My(42)
})
foo(
fun(): My {
return My(42)
}
)
}