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
@@ -2,5 +2,7 @@ internal annotation class A
internal annotation class B
class U(@param:A @field:B
var i: Int)
class U(
@param:A @field:B
var i: Int
)
@@ -1,5 +1,7 @@
internal annotation class Anon(val stringArray: Array<String>, val intArray: IntArray, // string
val string: String)
internal annotation class Anon(
val stringArray: Array<String>, val intArray: IntArray, // string
val string: String
)
@Anon(string = "a", stringArray = ["a", "b"], intArray = [1, 2])
@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FIELD)
@@ -1,6 +1,5 @@
internal class C(
private val p1: Int /* parameter p1 */ // field p1
,
private val p1: Int, /* parameter p1 */ // field p1
/**
* Field myP2
*/
@@ -1,12 +1,18 @@
internal class C1(arg1: Int,
arg2: Int,
arg3: Int) {
internal class C1(
arg1: Int,
arg2: Int,
arg3: Int
) {
constructor(x: Int,
y: Int) : this(x, x + y, 0) {
constructor(
x: Int,
y: Int
) : this(x, x + y, 0) {
}
}
internal class C2(private val arg1: Int,
private val arg2: Int,
arg3: Int)
internal class C2(
private val arg1: Int,
private val arg2: Int,
arg3: Int
)
+2 -1
View File
@@ -1,4 +1,5 @@
internal class A(// comment for field2 getter
internal class A(
// comment for field2 getter
// comment for field2 setter
var field2: Int // comment for field2
) {
@@ -1,6 +1,8 @@
internal annotation class TestAnnotation
class Test(@param:TestAnnotation @field:TestAnnotation
@get:TestAnnotation
@set:TestAnnotation
var arg: String?)
class Test(
@param:TestAnnotation @field:TestAnnotation
@get:TestAnnotation
@set:TestAnnotation
var arg: String?
)
@@ -1,7 +1,9 @@
@Deprecated("Ph'nglui mglw'nafh\n" +
" Cthulhu R'lyeh wgah'nagl fhtagn.\n" +
" 'In His House at R'lyeh\n" +
" Dead Cthulhu waits dreaming,\n" +
" yet He shall rise and His kingdom\n" +
" shall cover the Earth.'")
@Deprecated(
"Ph'nglui mglw'nafh\n" +
" Cthulhu R'lyeh wgah'nagl fhtagn.\n" +
" 'In His House at R'lyeh\n" +
" Dead Cthulhu waits dreaming,\n" +
" yet He shall rise and His kingdom\n" +
" shall cover the Earth.'"
)
class TestDeprecatedInJavadocWithMultilineMessage
+4 -2
View File
@@ -2,7 +2,9 @@ internal enum class Color : Runnable {
WHITE, BLACK, RED, YELLOW, BLUE;
override fun run() {
println("name()=" + name +
", toString()=" + toString())
println(
"name()=" + name +
", toString()=" + toString()
)
}
}
@@ -2,9 +2,10 @@ internal class F {
fun f1(p1: Int, p2: Int, p3: Int, p4: Int, vararg p5: Int) {}
fun f2(array: IntArray) {
f1(1, 2,
f1(
1, 2,
3, 4,
*array
)
}
}
}
@@ -3,11 +3,14 @@ internal class C {
fun foo2(
p1: Int,
p2: Int) {
p2: Int
) {
}
fun foo3(p1: Int,
p2: Int) {
fun foo3(
p1: Int,
p2: Int
) {
}
fun foo4(
@@ -2,11 +2,13 @@
import java.util.*
internal class A<T> {
fun foo(nonMutableCollection: Collection<String>,
fun foo(
nonMutableCollection: Collection<String>,
mutableCollection: MutableCollection<String>,
mutableSet: MutableSet<T>,
mutableMap: MutableMap<String, T>) {
mutableMap: MutableMap<String, T>
) {
mutableCollection.addAll(nonMutableCollection)
mutableSet.add(mutableMap.remove("a"))
}
}
}
@@ -2,8 +2,10 @@ internal class C(p1: Int, p2: Int, p3: Int)
internal class User {
fun foo() {
C(1,
C(
1,
2,
3)
3
)
}
}
}
+5 -3
View File
@@ -24,9 +24,11 @@ internal class Client : Frame() {
addWindowListener(a)
addWindowListener(object : WindowAdapter() {
override fun windowClosing() {}
})
addWindowListener(
object : WindowAdapter() {
override fun windowClosing() {}
}
)
val b = object : EmptyWindowListener {
@@ -5,10 +5,12 @@ internal interface I {
internal class C {
val `object`: Any?
get() {
foo(object : I {
override val int: Int
get() = 0
})
foo(
object : I {
override val int: Int
get() = 0
}
)
return string
}
@@ -9,12 +9,15 @@ class C {
@Throws(IOException::class)
internal fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream ->
bar(object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
}, stream)
bar(
object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
},
stream
)
}
}
@@ -22,4 +25,4 @@ class C {
internal fun bar(i: I, stream: InputStream): Int {
return i.doIt(stream)
}
}
}
@@ -9,12 +9,15 @@ class C {
@Throws(IOException::class)
internal fun foo(): Int {
ByteArrayInputStream(ByteArray(10)).use { stream ->
return bar(object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
}, stream)
return bar(
object : I {
@Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
},
stream
)
}
}
@@ -22,4 +25,4 @@ class C {
internal fun bar(i: I, stream: InputStream): Int {
return i.doIt(stream)
}
}
}