Add MultiFileHighlightingTest which checks that other files are not parsed during highlighting

This commit is contained in:
Pavel V. Talanov
2014-04-22 18:27:46 +04:00
parent b3898cfb0d
commit c9eb313ec4
10 changed files with 291 additions and 0 deletions
@@ -0,0 +1,11 @@
package test
import delegates.*
import util.*
fun f() {
val d = D(C("", 0), object : T2 {})
d.anotherFun()
d.<error>invalidFun</error>()
WithDelegatedProperty().i
}
@@ -0,0 +1,12 @@
package delegates
import util.*
class D(val t: T, val t2: T2): T by t, T2 by t2 {
fun anotherFun() {
}
}
class WithDelegatedProperty() {
val i: Int by someInvalidCode
}
@@ -0,0 +1,18 @@
package enums
trait Base {
fun f() {
}
}
enum class E(val i: Int = 0): Base {
E1: E() {
override fun f() {
}
}
E2: E(3) {
override fun f() {
}
}
E3
}
@@ -0,0 +1,49 @@
public package util
trait T {
fun f()
}
trait T2 {
fun g() {
}
}
suppress("UNRESOLVED_REFERENCE")
class Invalid: I
class A(val i: Int)
suppress("FINAL_SUPERTYPE")
class B: A(1) {
}
open class C(val s: String, i: Int): A(i), T {
override fun f() {}
}
fun topLevelFun(u: A): A {
return A(u.i)
}
val topLevelVal: A = C("", 0)
var topLevelVar: A = B()
object topLevelObject: T {
override fun f() {
}
fun g() {
}
}
fun funWithUnspecifiedType() = 3
fun funWithVararg(vararg i: Int): IntArray {
return i
}
fun <T, G> funWithWhere(a: G, b: T) where T: Collection<G> {
}
@@ -0,0 +1,17 @@
package some
import enums.E
import enums.Base
fun f(<warning>e</warning>: Base) {
}
fun test() {
f(E.E1)
f(E.E2)
f(E.E3)
f(E.<error>E4</error>)
f(E.<error>Invalid</error>)
E.E1.f()
}
@@ -0,0 +1,8 @@
package shouldFail
import util.*
fun f() {
val c = funWithUnspecifiedType()
c + 3
}
@@ -0,0 +1,23 @@
package first
import util.*
fun test() {
topLevelFun(topLevelVar)
topLevelFun(topLevelVal)
val c = C("ff", 1)
c.s.<error>invalid</error>
val <warning>b</warning> = B()
funWithVararg(1, 2, 3)
val <warning>i</warning> = Invalid()
topLevelObject.f()
topLevelObject.g()
}
fun testWhere(list: List<Int>) {
funWithWhere(1, list)
<error>funWithWhere</error>(1, 2)
}
class Example : C("foo", 0)
class Example2 : <error>A</error>(2)