Create From Usage: Move "Create function"-related tests to separate directory

This commit is contained in:
Alexey Sedunov
2014-09-29 16:36:57 +04:00
parent 0f43d4d07c
commit a6ba3a569d
138 changed files with 526 additions and 504 deletions
@@ -0,0 +1,9 @@
// "Create function 'iterator' from usage" "true"
class Foo<T> {
fun iterator(): Iterator<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun foo() {
for (i: Int in Foo<Int>()) { }
}
@@ -0,0 +1,12 @@
// "Create function 'iterator' from usage" "true"
class Foo<T> {
fun iterator(): Iterator<String> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun foo() {
for (i in Foo<Int>()) {
bar(i)
}
}
fun bar(i: String) { }
@@ -0,0 +1,22 @@
// "Create function 'next' from usage" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
fun next(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
class Foo<T> {
fun iterator(): FooIterator<String> {
throw UnsupportedOperationException("not implemented")
}
}
fun Any.component1(): Int {
return 0
}
fun Any.component2(): Int {
return 0
}
fun foo() {
for ((i: Int, j: Int) in Foo<Int>()) { }
}
@@ -0,0 +1,5 @@
// "Create function 'iterator' from usage" "true"
class Foo<T>
fun foo() {
for (i: Int in Foo<caret><Int>()) { }
}
@@ -0,0 +1,8 @@
// "Create function 'iterator' from usage" "true"
class Foo<T>
fun foo() {
for (i in Foo<caret><Int>()) {
bar(i)
}
}
fun bar(i: String) { }
@@ -0,0 +1,18 @@
// "Create function 'next' from usage" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
}
class Foo<T> {
fun iterator(): FooIterator<String> {
throw UnsupportedOperationException("not implemented")
}
}
fun Any.component1(): Int {
return 0
}
fun Any.component2(): Int {
return 0
}
fun foo() {
for ((i: Int, j: Int) in Foo<caret><Int>()) { }
}