New J2K: fix tests due to changes in inspections behaviour
This commit is contained in:
+5
-10
@@ -42,7 +42,7 @@ internal class Java8Class {
|
||||
}
|
||||
|
||||
fun testMemberFunctionThroughClass() {
|
||||
val memberFunFromClass: JFunction2<Java8Class, Int> = JFunction2 { obj: Java8Class -> obj.memberFun() }
|
||||
val memberFunFromClass = JFunction2 { obj: Java8Class -> obj.memberFun() }
|
||||
memberFunFromClass.foo(Java8Class())
|
||||
MethodReferenceHelperClass.staticFun2 { obj: Java8Class -> obj.memberFun() }
|
||||
h.memberFun2 { obj: Java8Class -> obj.memberFun() }
|
||||
@@ -54,23 +54,19 @@ internal class Java8Class {
|
||||
memberFunFromSameClass.foo()
|
||||
MethodReferenceHelperClass.staticFun0 { obj.memberFun() }
|
||||
h.memberFun0 { obj.memberFun() }
|
||||
|
||||
val anotherObj = Test()
|
||||
val memFunFromAnotherClass = JFunction0 { anotherObj.memberFun() }
|
||||
memFunFromAnotherClass.foo()
|
||||
MethodReferenceHelperClass.staticFun0 { anotherObj.memberFun() }
|
||||
h.memberFun0 { anotherObj.memberFun() }
|
||||
|
||||
val memberFunThroughObj1 = JFunction0 { field.memberFun() }
|
||||
memberFunThroughObj1.foo()
|
||||
MethodReferenceHelperClass.staticFun0 { field.memberFun() }
|
||||
h.memberFun0 { field.memberFun() }
|
||||
|
||||
val memberFunThroughObj2 = JFunction0 { Test.field.memberFun() }
|
||||
memberFunThroughObj2.foo()
|
||||
MethodReferenceHelperClass.staticFun0 { Test.field.memberFun() }
|
||||
h.memberFun0 { Test.field.memberFun() }
|
||||
|
||||
val memberFunThroughObj3 = JFunction0 { Test.staticFun().memberFun() }
|
||||
memberFunThroughObj3.foo()
|
||||
MethodReferenceHelperClass.staticFun0 { Test.staticFun().memberFun() }
|
||||
@@ -90,7 +86,7 @@ internal class Java8Class {
|
||||
constructorAnotherClass.foo()
|
||||
MethodReferenceHelperClass.staticFun0 { Test() }
|
||||
h.memberFun0 { Test() }
|
||||
val constructorAnotherClassWithParam: JFunction2<Int, Test> = JFunction2 { i: Int -> Test(i) }
|
||||
val constructorAnotherClassWithParam = JFunction2 { i: Int -> Test(i) }
|
||||
constructorAnotherClassWithParam.foo(1)
|
||||
MethodReferenceHelperClass.staticFun2 { i: Int -> Test(i) }
|
||||
h.memberFun2 { i: Int -> Test(i) }
|
||||
@@ -105,18 +101,18 @@ internal class Java8Class {
|
||||
}
|
||||
|
||||
fun testLibraryFunctions() {
|
||||
val memberFunFromClass: JFunction2<String, Int> = JFunction2 { obj: String -> obj.length }
|
||||
val memberFunFromClass = JFunction2 { obj: String -> obj.length }
|
||||
memberFunFromClass.foo("str")
|
||||
Thread(Runnable { println() }).start()
|
||||
Runnable { println() }.run()
|
||||
}
|
||||
|
||||
fun testOverloads() {
|
||||
val constructorWithoutParams: JFunction1<String> = JFunction1 { Test.testOverloads() }
|
||||
val constructorWithoutParams = JFunction1 { Test.testOverloads() }
|
||||
constructorWithoutParams.foo()
|
||||
MethodReferenceHelperClass.staticFun1 { Test.testOverloads() }
|
||||
h.memberFun1 { Test.testOverloads() }
|
||||
val constructorWithParam: JFunction2<Int, String> = JFunction2 { i: Int -> Test.testOverloads(i) }
|
||||
val constructorWithParam = JFunction2 { i: Int -> Test.testOverloads(i) }
|
||||
constructorWithParam.foo(2)
|
||||
MethodReferenceHelperClass.staticFun2 { i: Int -> Test.testOverloads(i) }
|
||||
h.memberFun2 { i: Int -> Test.testOverloads(i) }
|
||||
@@ -134,7 +130,6 @@ internal class Java8Class {
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
fun staticFun(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user