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,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(arg: T): 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) foo 2
}
@@ -0,0 +1,11 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T) {
fun compareTo(arg: T): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
A(1) >= 2
}
@@ -0,0 +1,11 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
2 in A(1)
}
@@ -0,0 +1,11 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T) {
fun compareTo(arg: T): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
A(1) < 2
}
@@ -0,0 +1,11 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
2 !in A(1)
}
@@ -0,0 +1,11 @@
// "Create function 'plusAssign' from usage" "true"
class A<T>(val n: T) {
fun plusAssign(arg: T): Unit {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
A(1) += 2
}
@@ -0,0 +1,13 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(): A<T> = throw Exception()
fun plus(arg: T): 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) + 2
}
@@ -0,0 +1,12 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
var a = A(1)
a = a + 2
}
@@ -0,0 +1,13 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(i: Int, s: String): A<T> = throw Exception()
fun plus(arg: T): 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) + 2
}
@@ -0,0 +1,11 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = 2 + A(1)
}
fun Int.plus(A: A<Int>): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,11 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(arg: T): 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) + 2
}
@@ -0,0 +1,11 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(i: Int): 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) + 2
}
@@ -0,0 +1,13 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
when {
2 in A(1) -> {}
}
}
@@ -0,0 +1,13 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
when {
2 !in A(1) -> {}
}
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = A(1) <caret>foo 2
}
@@ -0,0 +1,7 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T)
fun test() {
A(1) <caret>>= 2
}
@@ -0,0 +1,7 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
2 <caret>in A(1)
}
@@ -0,0 +1,7 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T)
fun test() {
A(1) <caret>< 2
}
@@ -0,0 +1,7 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
2 <caret>!in A(1)
}
@@ -0,0 +1,7 @@
// "Create function 'plusAssign' from usage" "true"
class A<T>(val n: T)
fun test() {
A(1) <caret>+= 2
}
@@ -0,0 +1,9 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(): A<T> = throw Exception()
}
fun test() {
val a: A<Int> = A(1) + <caret>2
}
@@ -0,0 +1,8 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
var a = A(1)
a = a <caret>+ 2
}
@@ -0,0 +1,9 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(i: Int, s: String): A<T> = throw Exception()
}
fun test() {
val a: A<Int> = A(1) <caret>+ 2
}
@@ -0,0 +1,7 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = 2 <caret>+ A(1)
}
@@ -0,0 +1,7 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = A(1) <caret>+ 2
}
@@ -0,0 +1,7 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test<U>(u: U) {
val a: A<U> = A(u) <caret>+ 2
}
@@ -0,0 +1,9 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
when {
2 <caret>in A(1) -> {}
}
}
@@ -0,0 +1,9 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
when {
2 <caret>!in A(1) -> {}
}
}