Add tests for 'if-when' and 'when' transformations

This commit is contained in:
Alexey Sedunov
2013-04-26 14:36:31 +04:00
parent 06d43a8ab3
commit 7dd5a2cfa4
68 changed files with 799 additions and 2 deletions
@@ -0,0 +1,11 @@
fun test(n: Int): String {
return <caret>when(n) {
in 0..10 -> "small"
in 10..100 -> "average"
else -> when(n) {
in 100..1000 -> "big"
in 1000..10000 -> "very big"
else -> "unknown"
}
}
}
@@ -0,0 +1,9 @@
fun test(n: Int): String {
return <caret>when (n) {
in 0..10 -> "small"
in 10..100 -> "average"
in 100..1000 -> "big"
in 1000..10000 -> "very big"
else -> "unknown"
}
}
@@ -0,0 +1,12 @@
//IS_APPLICABLE: false
fun test(n: Int): String {
return <caret>when(n) {
in 0..10 -> "small"
in 10..100 -> "average"
else -> when {
n in 100..1000 -> "big"
n in 1000..10000 -> "very big"
else -> "unknown"
}
}
}
@@ -0,0 +1,11 @@
fun test(n: Int): String {
return <caret>when {
n in 0..10 -> "small"
n in 10..100 -> "average"
else -> when {
n in 100..1000 -> "big"
n in 1000..10000 -> "very big"
else -> "unknown"
}
}
}
@@ -0,0 +1,9 @@
fun test(n: Int): String {
return <caret>when {
n in 0..10 -> "small"
n in 10..100 -> "average"
n in 100..1000 -> "big"
n in 1000..10000 -> "very big"
else -> "unknown"
}
}