Merge boxMultiFile testData into box, delete BoxMultiFile test
This commit is contained in:
committed by
Alexander Udalov
parent
e115f80d6c
commit
16a0ddd2fb
@@ -0,0 +1,9 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box() = a.x
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
package a
|
||||
|
||||
internal val x: String = "OK"
|
||||
@@ -0,0 +1,30 @@
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
|
||||
package thispackage
|
||||
|
||||
import otherpackage.*
|
||||
|
||||
fun box(): String {
|
||||
if (!localUse()) {
|
||||
return "local use failed"
|
||||
}
|
||||
if (!fromOtherPackage()) {
|
||||
return "use from other package failed"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun localUse(): Boolean {
|
||||
val c = Runnable::class.java
|
||||
return (c.getName()!! == "java.lang.Runnable")
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
package otherpackage
|
||||
|
||||
fun fromOtherPackage(): Boolean {
|
||||
val c = Runnable::class.java
|
||||
return (c.getName()!! == "java.lang.Runnable")
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box() = foo()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
private val a = "OK"
|
||||
fun foo() : String {
|
||||
return "${a}"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
public var v1: String = "V1"
|
||||
|
||||
fun box(): String {
|
||||
val s = "v1: $v1, v2: $v2"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
public var v2: String = "V2"
|
||||
@@ -0,0 +1,28 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
import testing.ClassWithInternals
|
||||
|
||||
public class HelloServer() : ClassWithInternals() {
|
||||
public override fun start() {
|
||||
val test = foo() + someGetter //+ some
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
HelloServer().start()
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
package testing; // There is no error if both files are in default package
|
||||
|
||||
public abstract class ClassWithInternals {
|
||||
protected var some: Int = 0;
|
||||
protected var someGetter: Int = 0
|
||||
get() = 5
|
||||
|
||||
protected fun foo() : Int = 0
|
||||
|
||||
public abstract fun start() : Unit;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
public fun box(): String {
|
||||
return B().test(B())
|
||||
}
|
||||
|
||||
public class B : A() {
|
||||
public fun test(other:Any): String {
|
||||
if (other is B && other.s == 2) {
|
||||
return "OK"
|
||||
}
|
||||
return "fail"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
package test
|
||||
|
||||
open class A {
|
||||
@JvmField protected val s = 2;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
|
||||
package test2
|
||||
|
||||
import test.A
|
||||
|
||||
class C : A() {
|
||||
fun a(): String {
|
||||
return this.s
|
||||
}
|
||||
}
|
||||
|
||||
public fun box(): String {
|
||||
return C().a()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
package test
|
||||
|
||||
open class A {
|
||||
@JvmField protected val s = "OK";
|
||||
}
|
||||
Reference in New Issue
Block a user