"Find Usages": separate Kotlin and Java tests

This commit is contained in:
Alexey Sedunov
2013-10-28 20:59:50 +04:00
parent f1a7d707a0
commit f41cfa2b8b
160 changed files with 328 additions and 313 deletions
@@ -0,0 +1,40 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: overrides
open class A<T> {
open fun <caret>foo(t: T) {
println(t)
}
open fun foo(t: T, tt: T) {
println(t)
}
}
fun <T> A<T>.foo(t: T, x: String) {
foo(t)
println(x)
}
fun A<String>.foo(s: String, n: Number) {
fun <T> A<T>.foo(t: T, x: String) {
foo(t)
println(x)
}
foo(s)
println(n)
}
open class B: A<String>() {
override fun foo(t: String) {
super<A>.foo(t)
}
open fun baz(a: A<String>) {
a.foo("", 0)
}
open fun baz(a: A<Number>) {
a.foo(0, "")
}
}
@@ -0,0 +1,6 @@
class C extends A<String> {
@Override
public void foo(String s) {
super.foo(s);
}
}
@@ -0,0 +1,2 @@
Unclassified usage (29: 18) override fun foo(t: String) {
Unclassified usage (3: 17) public void foo(String s) {
@@ -0,0 +1,11 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
package testing;
public open class Server() {
public open fun <caret>processRequest() = "foo"
}
public class ServerEx(): Server() {
public override fun processRequest() = "foofoo"
}
@@ -0,0 +1,8 @@
import testing.*;
class Client {
public void foo() {
new Server().processRequest();
new ServerEx().processRequest();
}
}
@@ -0,0 +1,2 @@
Unclassified usage (5: 22) new Server().processRequest();
Unclassified usage (6: 24) new ServerEx().processRequest();
@@ -0,0 +1,11 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
fun foo() {
fun <caret>bar() {
}
bar()
}
bar()
@@ -0,0 +1,2 @@
Function call (8: 5) bar()
@@ -0,0 +1,15 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
fun foo() {
if (true) {
fun <caret>bar() {
}
bar()
}
bar()
}
bar()
@@ -0,0 +1,2 @@
Function call (9: 9) bar()
@@ -0,0 +1,12 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
package server;
public open class Server() {
open fun <caret>processRequest() = "foo"
}
public class ServerEx(): Server() {
override fun processRequest() = "foofoo"
}
@@ -0,0 +1,8 @@
import server.*;
class Client {
public fun foo() {
Server().processRequest()
ServerEx().processRequest()
}
}
@@ -0,0 +1,2 @@
Function call (5: 18) Server().processRequest()
Function call (6: 20) ServerEx().processRequest()
@@ -0,0 +1,45 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: overloadUsages
trait X<T> {
}
fun <T> X<T>.foo(a: Number, b: Number) {
println("$a$b")
}
fun bar(x: X<String>) {
x.foo(1, 2)
}
open class A<T>: X<T> {
open fun <caret>foo(t: T) {
println(t)
}
open fun foo(t: T, tt: T) {
println(t)
}
}
fun <T> A<T>.foo(t: T, x: String) {
foo(t)
println(x)
}
fun bar(a: A<Number>) {
a.foo(1, "")
}
fun B.foo(s: String, n: Number) {
fun <T> A<T>.foo(t: T, x: String) {
foo(t)
println(x)
}
foo(s)
println(n)
}
fun bar(b: B) {
b.foo("", 0)
}
@@ -0,0 +1,13 @@
open class B: A<String>() {
override fun foo(t: String) {
super<A>.foo(t)
}
open fun baz(a: A<String>) {
foo("", 0)
}
open fun baz(a: A<Number>) {
a.foo(0, "")
}
}
@@ -0,0 +1,7 @@
Function call (11: 11) a.foo(0, "")
Function call (11: 7) x.foo(1, 2)
Function call (25: 5) foo(t)
Function call (30: 7) a.foo(1, "")
Function call (35: 9) foo(t)
Function call (39: 5) foo(s)
Function call (3: 18) super<A>.foo(t)
@@ -0,0 +1,14 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
package server;
public open class Server() {
private fun <caret>doProcessRequest() = "foo"
open fun processRequest() = doProcessRequest()
}
public class ServerEx(): Server() {
override fun processRequest() = "foo" + doProcessRequest()
}
@@ -0,0 +1,8 @@
import server.*;
class Client {
public fun foo() {
Server().doProcessRequest()
ServerEx().processRequest()
}
}
@@ -0,0 +1,3 @@
Function call (12: 45) override fun processRequest() = "foo" + doProcessRequest()
Function call (5: 18) Server().doProcessRequest()
Function call (8: 33) open fun processRequest() = doProcessRequest()
@@ -0,0 +1,6 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
package server;
fun <caret>processRequest() = "foo"
@@ -0,0 +1,12 @@
package client
import server.processRequest
class Client {
val methodRef = ::processRequest()
fun doProcessRequest() {
println("Process...")
processRequest()
}
}
@@ -0,0 +1,11 @@
package client;
import server.ServerPackage;
class JClient {
String s = ServerPackage.processRequest();
String sendRequest() {
return ServerPackage.processRequest();
}
}
@@ -0,0 +1,5 @@
Callable reference (6: 23) val methodRef = ::processRequest()
Function call (10: 9) processRequest()
Import directive (3: 15) import server.processRequest
Unclassified usage (6: 30) String s = ServerPackage.processRequest();
Unclassified usage (9: 30) return ServerPackage.processRequest();
@@ -0,0 +1,6 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages, skipImports
package server;
fun <caret>processRequest() = "foo"
@@ -0,0 +1,12 @@
package client
import server.processRequest
class Client {
val methodRef = ::processRequest()
fun doProcessRequest() {
println("Process...")
processRequest()
}
}
@@ -0,0 +1,2 @@
Callable reference (6: 23) val methodRef = ::processRequest()
Function call (10: 9) processRequest()