Create From Usage: Move "Create function"-related tests to separate directory
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// "Create function 'component3' from usage" "true"
|
||||
class Foo<T> {
|
||||
fun component1(): Int { return 0 }
|
||||
fun component2(): Int { return 0 }
|
||||
|
||||
fun component3(): Any {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
fun foo() {
|
||||
val (a, b, c) = Foo<Int>()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create function 'component3' from usage" "true"
|
||||
class Foo<T> {
|
||||
fun component1(): Int { return 0 }
|
||||
fun component2(): Int { return 0 }
|
||||
|
||||
fun component3(): String {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
fun foo() {
|
||||
val (a, b, c: String) = Foo<Int>()
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// "Create function 'component2' from usage" "true"
|
||||
class FooIterator<T> {
|
||||
fun hasNext(): Boolean { return false }
|
||||
fun next(): Any {
|
||||
throw UnsupportedOperationException("not implemented")
|
||||
}
|
||||
}
|
||||
class Foo<T> {
|
||||
fun iterator(): FooIterator<String> {
|
||||
throw UnsupportedOperationException("not implemented")
|
||||
}
|
||||
}
|
||||
fun Any.component1(): Int {
|
||||
return 0
|
||||
}
|
||||
fun foo() {
|
||||
for ((i: Int, j: Int) in Foo<Int>()) { }
|
||||
}
|
||||
|
||||
fun Any.component2(): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create function 'component3' from usage" "true"
|
||||
class Foo<T> {
|
||||
fun component1(): Int { return 0 }
|
||||
fun component2(): Int { return 0 }
|
||||
}
|
||||
fun foo() {
|
||||
val (a, b, c) = Foo<caret><Int>()
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create function 'component3' from usage" "true"
|
||||
class Foo<T> {
|
||||
fun component1(): Int { return 0 }
|
||||
fun component2(): Int { return 0 }
|
||||
}
|
||||
fun foo() {
|
||||
val (a, b, c: String) = Foo<caret><Int>()
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Create function 'component2' from usage" "true"
|
||||
class FooIterator<T> {
|
||||
fun hasNext(): Boolean { return false }
|
||||
fun next(): Any {
|
||||
throw UnsupportedOperationException("not implemented")
|
||||
}
|
||||
}
|
||||
class Foo<T> {
|
||||
fun iterator(): FooIterator<String> {
|
||||
throw UnsupportedOperationException("not implemented")
|
||||
}
|
||||
}
|
||||
fun Any.component1(): Int {
|
||||
return 0
|
||||
}
|
||||
fun foo() {
|
||||
for ((i: Int, j: Int) in Foo<caret><Int>()) { }
|
||||
}
|
||||
Reference in New Issue
Block a user