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,12 @@
// "Create function 'inc' from usage" "true"
class A<T>(val n: T) {
fun inc(): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
var a = A(1)
a++
}
@@ -0,0 +1,13 @@
// "Create function 'minus' from usage" "true"
class A<T>(val n: T) {
fun minus(n: Int): A<T> = throw Exception()
fun minus(): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = -A(1)
}
@@ -0,0 +1,9 @@
// "Create function 'minus' from usage" "true"
fun test() {
val a = -false
}
fun Boolean.minus(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,11 @@
// "Create function 'minus' from usage" "true"
class A<T>(val n: T) {
fun minus(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a = -A(1)
}
@@ -0,0 +1,11 @@
// "Create function 'minus' from usage" "true"
class A<T>(val n: T) {
fun minus(): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test<U>(u: U) {
val a: A<U> = -A(u)
}
@@ -0,0 +1,8 @@
// "Create function 'inc' from usage" "true"
class A<T>(val n: T)
fun test() {
var a = A(1)
a<caret>++
}
@@ -0,0 +1,9 @@
// "Create function 'minus' from usage" "true"
class A<T>(val n: T) {
fun minus(n: Int): A<T> = throw Exception()
}
fun test() {
val a: A<Int> = <caret>-A(1)
}
@@ -0,0 +1,5 @@
// "Create function 'minus' from usage" "true"
fun test() {
val a = <caret>-false
}
@@ -0,0 +1,7 @@
// "Create function 'minus' from usage" "true"
class A<T>(val n: T)
fun test() {
val a = <caret>-A(1)
}
@@ -0,0 +1,7 @@
// "Create function 'minus' from usage" "true"
class A<T>(val n: T)
fun test<U>(u: U) {
val a: A<U> = <caret>-A(u)
}