[tests] Refactor AbstractReferenceResolveTest. Part 1
Instead of relying on UNRESOLVED_REFERENCE directive for the whole file, just render the unresolved reference right in the .txt testdata This will allow to introduce multi-caret resolve testdata more naturally Required for KT-65152 and KT-62695
This commit is contained in:
committed by
Space Team
parent
c958aef679
commit
304112cd8a
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
package test
|
||||
|
||||
interface Foo
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
package test
|
||||
|
||||
class B(val n: Int) {
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in test.B) operator fun set(i: kotlin.Int, a: test.B)
|
||||
Nothing (Unresolved reference)
|
||||
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
val foo: Int <caret>by Bar()
|
||||
|
||||
class Bar
|
||||
analysis/analysis-api/testData/referenceResolve/delegatedPropertyAccessors/withErrors/unresolved.txt
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
fun test() {
|
||||
for (x <caret>in Y()) {}
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
open class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
open class Base {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
analysis/analysis-api/testData/referenceResolve/kDoc/javaDeclarations/StaticFunctionFromBaseClass.kt
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
// FILE: main.kt
|
||||
import dependency.JavaBase
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
// FILE: main.kt
|
||||
import dependency.JavaBase
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
/**
|
||||
* [th<caret>is]
|
||||
*/
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
/**
|
||||
* [th<caret>is]
|
||||
*/
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
/**
|
||||
* [th<caret>is]
|
||||
*/
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// FE1.0 can resolve to `kotlin` package when it's not allowed
|
||||
// IGNORE_FE10
|
||||
// UNRESOLVED_REFERENCE
|
||||
// COMPILATION_ERRORS
|
||||
// FILE: a.kt
|
||||
package kotlin.pckg
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// NO_RUNTIME
|
||||
// UNRESOLVED_REFERENCE
|
||||
// IGNORE_FE10
|
||||
val (<caret>x)
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
fun bar(block: () -> Unit) {}
|
||||
|
||||
fun foo() {
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
class Foo {
|
||||
fun foo() {
|
||||
class Local {
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
@Deprecated("don't use i", level = DeprecationLevel.HIDDEN)
|
||||
val i: Int = 1
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
@@ -1,5 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
// FILE: main.kt
|
||||
import java.lang.* // will not import Fake
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
// FILE: main.kt
|
||||
fun foo() {
|
||||
<caret>Fake() // not imported within "java.lang.*" default import
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
// FILE: main.kt
|
||||
package nonRoot
|
||||
import java.lang.*
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
// FILE: main.kt
|
||||
package nonRoot
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
Vendored
-1
@@ -1,5 +1,4 @@
|
||||
// Should not fall on temp references in invalid code
|
||||
// UNRESOLVED_REFERENCE
|
||||
|
||||
object Testing {
|
||||
companion object {
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
// IGNORE_FE10
|
||||
|
||||
fun <T : Any, Z> createTuple(a: T, b: Z&Any): Pair<T, Z&Any> {
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
Reference in New Issue
Block a user