Dropped extra caret markers and introduced separate marker for referencing from context.

This commit is contained in:
Zalim Bashorov
2014-02-24 18:37:48 +04:00
parent 75e10322d0
commit 559ea28a6b
5 changed files with 9 additions and 10 deletions
@@ -1,7 +1,6 @@
class TestClass {
/* <caret> */
fun test() {
'<caret>'
}
}
@@ -3,19 +3,19 @@ trait T {
}
open class X: T {
override var <caret>foo: String
override var foo: String
get() = ""
set(value: String) {}
}
open trait Y: T {
override var <caret>foo: String
override var foo: String
get() = ""
set(value: String) {}
}
open class Z: Y {
override var <caret>foo: String
override var foo: String
get() = ""
set(value: String) {}
}
@@ -1,6 +1,6 @@
val a: <caret>Number? = null
// CONTEXT: public abstract fun toDouble() : <caret>Double
// CONTEXT: public abstract fun toDouble() : <ref-caret>Double
// RUNTIME
// REF: (jet).Double
@@ -2,7 +2,7 @@ import inlibrary.test.*
val a: <caret>ReferenceTest? = null
// CONTEXT: val test: <caret>Test? = null
// CONTEXT: val test: <ref-caret>Test? = null
// WITH_LIBRARY: /resolve/referenceInLib/inLibrarySource
// REF: (inlibrary.test).Test
@@ -26,7 +26,7 @@ import junit.framework.AssertionFailedError
public abstract class AbstractReferenceResolveInLibrarySourcesTest : JetLightCodeInsightFixtureTestCase() {
class object {
val CARET_MARKER = "<caret>"
private val REF_CARET_MARKER = "<ref-caret>"
}
fun doTest(path: String) {
@@ -47,10 +47,10 @@ public abstract class AbstractReferenceResolveInLibrarySourcesTest : JetLightCod
throw AssertionFailedError("'CONTEXT: ' directive is expected to set up position in library file: ${testedElementFile.getName()}")
}
val inContextOffset = lineContext.indexOf(CARET_MARKER)
if (inContextOffset == -1) throw IllegalStateException("No '$CARET_MARKER' marker found in 'CONTEXT: $lineContext'")
val inContextOffset = lineContext.indexOf(REF_CARET_MARKER)
if (inContextOffset == -1) throw IllegalStateException("No '$REF_CARET_MARKER' marker found in 'CONTEXT: $lineContext'")
val contextStr = lineContext.replace(CARET_MARKER, "")
val contextStr = lineContext.replace(REF_CARET_MARKER, "")
val offsetInFile = testedElementFile.getText()!!.indexOf(contextStr)
if (offsetInFile == -1) throw IllegalStateException("Context '$contextStr' wasn't found in file ${testedElementFile.getName()}")