tests: apply official code style

#KT-38632 Fixed
This commit is contained in:
Dmitry Gridin
2020-04-28 15:51:57 +07:00
parent d8f9643650
commit 11a3482970
406 changed files with 1785 additions and 1525 deletions
@@ -7,8 +7,8 @@ fun foo(list: List<String>, o: Any) {
unresolvedFun()
val result: Any? = list
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
}
@@ -7,9 +7,9 @@ fun foo(list: List<String>, o: Any) {
unresolvedFun()
val result: Any? = list
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
}
@@ -4,10 +4,10 @@
fun foo(list: List<String>, o: Any): Int? {
if (o is Int) {
return list
.map { it.length + o }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
.map { it.length + o }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
}
return 0
}
@@ -4,11 +4,11 @@
fun foo(list: List<String>, o: Any): Int? {
if (o is Int) {
return list
.asSequence()
.map { it.length + o }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
.asSequence()
.map { it.length + o }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
}
return 0
}
@@ -4,9 +4,9 @@
fun foo(list: List<String>, o: Any): Int? {
if (o is CharSequence) {
<caret>return list
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
return 0
}
@@ -4,10 +4,10 @@
fun foo(list: List<String>, o: Any): Int? {
if (o is CharSequence) {
<caret>return list
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
return 0
}
@@ -4,8 +4,8 @@
fun foo(list: List<String>, o: Any) {
if (o is CharSequence) {
val result: Any? = list
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
}
@@ -4,9 +4,9 @@
fun foo(list: List<String>, o: Any) {
if (o is CharSequence) {
val result: Any? = list
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
}
@@ -5,8 +5,8 @@ fun foo(list: List<String>, o: Any) {
var result: Any? = ""
if (o is CharSequence) {
result = list
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
}
@@ -5,9 +5,9 @@ fun foo(list: List<String>, o: Any) {
var result: Any? = ""
if (o is CharSequence) {
result = list
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.firstOrNull { it > 1000 }
}
}
@@ -4,8 +4,8 @@
fun foo(list: List<String>, o: Any, result: MutableCollection<Int>) {
if (o is CharSequence) {
list
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.filterTo(result) { it > 1000 }
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.filterTo(result) { it > 1000 }
}
}
@@ -4,9 +4,9 @@
fun foo(list: List<String>, o: Any, result: MutableCollection<Int>) {
if (o is CharSequence) {
list
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.filterTo(result) { it > 1000 }
.asSequence()
.map { it.length + (o as String).capitalize().hashCode() }
.map { it * o.length }
.filterTo(result) { it > 1000 }
}
}
@@ -3,8 +3,8 @@
// INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'"
fun foo(list: List<String>, o: Any): Int? {
<caret>return list
.map { it.length + (o as Int) }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
.map { it.length + (o as Int) }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'"
fun foo(list: List<String>, o: Any): Int? {
<caret>return list
.asSequence()
.map { it.length + (o as Int) }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
.asSequence()
.map { it.length + (o as Int) }
.filter { it > 0 }
.map { it * o.hashCode() }
.firstOrNull()
}
@@ -3,8 +3,8 @@
// INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'"
fun foo(list: List<Any>, o: Any): Int? {
return list
.filterIsInstance<String>()
.filter { it.length > 0 }
.map { it.length * 2 }
.firstOrNull()
.filterIsInstance<String>()
.filter { it.length > 0 }
.map { it.length * 2 }
.firstOrNull()
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence()...filter{}.map{}.firstOrNull()'"
fun foo(list: List<Any>, o: Any): Int? {
return list
.asSequence()
.filterIsInstance<String>()
.filter { it.length > 0 }
.map { it.length * 2 }
.firstOrNull()
.asSequence()
.filterIsInstance<String>()
.filter { it.length > 0 }
.map { it.length * 2 }
.firstOrNull()
}