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
@@ -3,7 +3,7 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'"
fun f(list: List<Int>) {
val <caret>result = list
.filter { it % 2 == 0 }
.max()
?: -1
.filter { it % 2 == 0 }
.max()
?: -1
}
@@ -3,8 +3,8 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'"
fun f(list: List<Int>) {
val <caret>result = list
.asSequence()
.filter { it % 2 == 0 }
.max()
?: -1
.asSequence()
.filter { it % 2 == 0 }
.max()
?: -1
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(lineCount: Int): Float {
val <caret>max_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.max()
?: 0.0f
.map { getLineWidth(it) }
.max()
?: 0.0f
return max_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(lineCount: Int): Float {
val <caret>max_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0f
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0f
return max_width
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(lineCount: Int): Float {
val <caret>max_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.max()
?: 0.0f
.map { getLineWidth(it) }
.max()
?: 0.0f
return max_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(lineCount: Int): Float {
val <caret>max_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0f
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0f
return max_width
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(lineCount: Int): Float {
val <caret>max_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.max()
?: 0.0f
.map { getLineWidth(it) }
.max()
?: 0.0f
return max_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(lineCount: Int): Float {
val <caret>max_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0f
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0f
return max_width
}
@@ -3,6 +3,6 @@
// IS_APPLICABLE_2: false
fun getMaxLineWidth(list: List<Float>): Float {
val <caret>max = list.max()
?: 0.0f
?: 0.0f
return max
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(count: Int): Double {
val max = (0..count-1)
.map { getLineWidth(it) }
.max()
?: 0.0
.map { getLineWidth(it) }
.max()
?: 0.0
return max
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
fun getMaxLineWidth(count: Int): Double {
val max = (0..count-1)
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0
return max
}
@@ -3,8 +3,8 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.max()'"
fun getMaxLineWidth(list: List<Double>): Double {
val <caret>max = list
.mapIndexed { i, item -> item * i }
.max()
?: 0.0
.mapIndexed { i, item -> item * i }
.max()
?: 0.0
return max
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.max()'"
fun getMaxLineWidth(list: List<Double>): Double {
val <caret>max = list
.asSequence()
.mapIndexed { i, item -> item * i }
.max()
?: 0.0
.asSequence()
.mapIndexed { i, item -> item * i }
.max()
?: 0.0
return max
}
@@ -5,9 +5,9 @@ import java.lang.Math.max
fun getMaxLineWidth(count: Int): Double {
val <caret>m = (0..count-1)
.map { getLineWidth(it) }
.max()
?: 0.0
.map { getLineWidth(it) }
.max()
?: 0.0
return m
}
@@ -5,10 +5,10 @@ import java.lang.Math.max
fun getMaxLineWidth(count: Int): Double {
val <caret>m = (0..count-1)
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0
.asSequence()
.map { getLineWidth(it) }
.max()
?: 0.0
return m
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,9 +3,9 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}
@@ -3,10 +3,10 @@
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
fun getMinLineWidth(lineCount: Int): Double {
val <caret>min_width = (0..lineCount - 1)
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
.asSequence()
.map { getLineWidth(it) }
.min()
?: Double.MAX_VALUE
return min_width
}