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 -1
View File
@@ -13,7 +13,7 @@ class A {
return JetBundle.message(
"x.in.y",
DescriptorRenderer.COMPACT.render(declarationDescriptor),
IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.render(containingDescriptor)
IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.render(containingDescriptor),
)
}
}
+4 -2
View File
@@ -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)
+2 -1
View File
@@ -1,7 +1,8 @@
import javaApi.SpecialExternal
//Annotation class:
annotation class Special(val names: Array<String> //array is used
annotation class Special(
val names: Array<String> //array is used
) //Class with annotation:
@Special(names = ["name1"])
@@ -1,7 +1,9 @@
internal class C(// field p1
private val p1: Int /* parameter p1 */,
internal class C(
// field p1
private val p1: Int, /* parameter p1 */
/**
* Field myP2
*/
private val myP2: Int, /* Field p3 */
var p3: Int)
var p3: Int
)
@@ -1,11 +1,17 @@
internal class C1(arg1: Int,
arg2: Int,
arg3: Int) {
constructor(x: Int,
y: Int) : this(x, x + y, 0) {
internal class C1(
arg1: Int,
arg2: Int,
arg3: Int
) {
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
)
+4 -2
View File
@@ -1,7 +1,9 @@
internal class A(// comment for field2 setter
internal class A(
// comment for field2 setter
// comment for field2 getter
var field2 // comment for field2
: Int) {
: Int
) {
/**
* Comment for field1 setter
*/
@@ -2,6 +2,8 @@ internal annotation class TestAnnotationField
internal annotation class TestAnnotationParam
internal annotation class TestAnnotationGet
internal annotation class TestAnnotationSet
class Test(@field:TestAnnotationField @set:TestAnnotationSet
@get:TestAnnotationGet
@param:TestAnnotationParam var arg: String)
class Test(
@field:TestAnnotationField @set:TestAnnotationSet
@get:TestAnnotationGet
@param:TestAnnotationParam var arg: String
)
@@ -1,7 +1,9 @@
@Deprecated("""Ph'nglui mglw'nafh
@Deprecated(
"""Ph'nglui mglw'nafh
Cthulhu R'lyeh wgah'nagl fhtagn.
'In His House at R'lyeh
Dead Cthulhu waits dreaming,
yet He shall rise and His kingdom
shall cover the Earth.'""")
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()
)
}
}
@@ -1,7 +1,8 @@
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
)
@@ -2,11 +2,14 @@ internal class C {
fun foo1(p1: Int, p2: Int) {}
fun foo2(
p1: Int,
p2: Int) {
p2: Int
) {
}
fun foo3(p1: Int,
p2: Int) {
fun foo3(
p1: Int,
p2: Int
) {
}
fun foo4(
+5 -3
View File
@@ -1,6 +1,8 @@
class TestJavaBoxedPrimitives {
fun foo(x1: Boolean, x2: Byte, x3: Short, x4: Int,
x5: Long, x6: Float, x7: Double, x8: Char): Array<Any> {
fun foo(
x1: Boolean, x2: Byte, x3: Short, x4: Int,
x5: Long, x6: Float, x7: Double, x8: Char
): Array<Any> {
return arrayOf(x1, x2, x3, x4, x5, x6, x7, x8)
}
}
}
+6 -4
View File
@@ -66,15 +66,17 @@ internal class A {
val s = "test string"
s == "test"
s.equals(
"tesT"
, ignoreCase = true)
"tesT",
ignoreCase = true
)
s.compareTo("Test", ignoreCase = true)
s.regionMatches(
0,
"TE",
0,
2
, ignoreCase = true)
2,
ignoreCase = true
)
s.regionMatches(0, "st", 1, 2)
s.replace("\\w+".toRegex(), "---")
.replaceFirst("([s-t])".toRegex(), "A$1")
@@ -1,8 +1,10 @@
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"))
}
+4 -2
View File
@@ -1,8 +1,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
@@ -20,9 +20,11 @@ internal class Client : Frame() {
override fun windowClosing() {}
}
addWindowListener(a)
addWindowListener(object : WindowAdapter() {
override fun windowClosing() {}
})
addWindowListener(
object : WindowAdapter() {
override fun windowClosing() {}
}
)
val b: EmptyWindowListener = object : EmptyWindowListener {}
val c: EmptyWindowAdapter = object : EmptyWindowAdapter() {}
}
+6 -4
View File
@@ -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
}
@@ -11,12 +11,15 @@ class C {
@Throws(IOException::class)
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
)
}
}
@@ -11,12 +11,15 @@ class C {
@Throws(IOException::class)
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
)
}
}