Extract Function: Add test data

This commit is contained in:
Alexey Sedunov
2014-04-10 20:09:13 +04:00
parent 4dec0508a6
commit 0d90dcf010
111 changed files with 1596 additions and 13 deletions
@@ -0,0 +1,12 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
var c: Int = 1
<selection>b += a
c -= a
println(b)
println(c)</selection>
return b
}
@@ -0,0 +1 @@
Selected code fragment has multiple output values: b c
@@ -0,0 +1,16 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
var c: Int = 1
<selection>if (a > 0) {
b += a
}
else {
c -= a
}
println(b)
println(c)</selection>
return b
}
@@ -0,0 +1 @@
Selected code fragment has multiple output values: b c
@@ -0,0 +1,18 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
var c: Int = 1
<selection>when {
a > 0 -> {
b += a
}
else -> {
c -= a
}
}
println(b)
println(c)</selection>
return b
}
@@ -0,0 +1 @@
Selected code fragment has multiple output values: b c
@@ -0,0 +1,9 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
<selection>b += a
println(b)</selection>
return b
}
@@ -0,0 +1,15 @@
// NEXT_SIBLING:
fun i(a: Int, b: Int): Int {
var b1 = b
b1 += a
println(b1)
return b1
}
fun foo(a: Int): Int {
var b: Int = 1
b = i(a, b)
return b
}
@@ -0,0 +1,11 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
<selection>if (a > 0) {
b = b + 1
}
println(b)</selection>
return b
}
@@ -0,0 +1,17 @@
// NEXT_SIBLING:
fun i(a: Int, b: Int): Int {
var b1 = b
if (a > 0) {
b1 = b1 + 1
}
println(b1)
return b1
}
fun foo(a: Int): Int {
var b: Int = 1
b = i(a, b)
return b
}
@@ -0,0 +1,17 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
<selection>if (a > 0) {
b = b + 1
}
else if (a < 0) {
b--
}
else {
b = a
}
println(b)</selection>
return b
}
@@ -0,0 +1,21 @@
// NEXT_SIBLING:
fun i(a: Int, b: Int): Int {
var b1 = b
if (a > 0) {
b1 = b1 + 1
} else if (a < 0) {
b1--
} else {
b1 = a
}
println(b1)
return b1
}
fun foo(a: Int): Int {
var b: Int = 1
b = i(a, b)
return b
}
@@ -0,0 +1,16 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
<selection> when {
a > 0 -> {
b = b + 1
}
a < 0 -> {
b = b - 1
}
}
println(b)</selection>
return b
}
@@ -0,0 +1,22 @@
// NEXT_SIBLING:
fun i(a: Int, b: Int): Int {
var b1 = b
when {
a > 0 -> {
b1 = b1 + 1
}
a < 0 -> {
b1 = b1 - 1
}
}
println(b1)
return b1
}
fun foo(a: Int): Int {
var b: Int = 1
b = i(a, b)
return b
}
@@ -0,0 +1,19 @@
// NEXT_SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
<selection> when {
a > 0 -> {
b = b + 1
}
a < 0 -> {
b = b - 1
}
else -> {
b = a
}
}
println(b)</selection>
return b
}
@@ -0,0 +1,25 @@
// NEXT_SIBLING:
fun i(a: Int, b: Int): Int {
var b1 = b
when {
a > 0 -> {
b1 = b1 + 1
}
a < 0 -> {
b1 = b1 - 1
}
else -> {
b1 = a
}
}
println(b1)
return b1
}
fun foo(a: Int): Int {
var b: Int = 1
b = i(a, b)
return b
}