[PL][tests] Keep PL test data under "testData/klib/" dir
This commit is contained in:
committed by
Space Team
parent
9e3afe7a1f
commit
5c3e63e19a
@@ -0,0 +1,45 @@
|
||||
sealed class SC1 {
|
||||
class C1 : SC1()
|
||||
object O1 : SC1()
|
||||
class Removed : SC1()
|
||||
class C2 : SC1()
|
||||
object O2 : SC1()
|
||||
}
|
||||
|
||||
sealed class SC2 {
|
||||
class C1 : SC2()
|
||||
object O1 : SC2()
|
||||
object Removed : SC2()
|
||||
class C2 : SC2()
|
||||
object O2 : SC2()
|
||||
}
|
||||
|
||||
sealed interface SI1 {
|
||||
class C1 : SI1
|
||||
object O1 : SI1
|
||||
interface I1 : SI1
|
||||
class Removed : SI1
|
||||
class C2 : SI1
|
||||
object O2 : SI1
|
||||
interface I2 : SI1
|
||||
}
|
||||
|
||||
sealed interface SI2 {
|
||||
class C1 : SI2
|
||||
object O1 : SI2
|
||||
interface I1 : SI2
|
||||
object Removed : SI2
|
||||
class C2 : SI2
|
||||
object O2 : SI2
|
||||
interface I2 : SI2
|
||||
}
|
||||
|
||||
sealed interface SI3 {
|
||||
class C1 : SI3
|
||||
object O1 : SI3
|
||||
interface I1 : SI3
|
||||
interface Removed : SI3
|
||||
class C2 : SI3
|
||||
object O2 : SI3
|
||||
interface I2 : SI3
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
sealed class SC1 {
|
||||
class C1 : SC1()
|
||||
object O1 : SC1()
|
||||
// class Removed : SC1()
|
||||
class C2 : SC1()
|
||||
object O2 : SC1()
|
||||
}
|
||||
|
||||
sealed class SC2 {
|
||||
class C1 : SC2()
|
||||
object O1 : SC2()
|
||||
// object Removed : SC2()
|
||||
class C2 : SC2()
|
||||
object O2 : SC2()
|
||||
}
|
||||
|
||||
sealed interface SI1 {
|
||||
class C1 : SI1
|
||||
object O1 : SI1
|
||||
interface I1 : SI1
|
||||
// class Removed : SI1
|
||||
class C2 : SI1
|
||||
object O2 : SI1
|
||||
interface I2 : SI1
|
||||
}
|
||||
|
||||
sealed interface SI2 {
|
||||
class C1 : SI2
|
||||
object O1 : SI2
|
||||
interface I1 : SI2
|
||||
// object Removed : SI2
|
||||
class C2 : SI2
|
||||
object O2 : SI2
|
||||
interface I2 : SI2
|
||||
}
|
||||
|
||||
sealed interface SI3 {
|
||||
class C1 : SI3
|
||||
object O1 : SI3
|
||||
interface I1 : SI3
|
||||
// interface Removed : SI3
|
||||
class C2 : SI3
|
||||
object O2 : SI3
|
||||
interface I2 : SI3
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,45 @@
|
||||
fun compute(sealedClass: SC1): String = when (sealedClass) {
|
||||
is SC1.C1 -> "OK"
|
||||
SC1.O1 -> "OK"
|
||||
is SC1.Removed -> "FAIL1"
|
||||
is SC1.C2 -> "FAIL2"
|
||||
SC1.O2 -> "FAIL3"
|
||||
}
|
||||
|
||||
fun compute(sealedClass: SC2): String = when (sealedClass) {
|
||||
is SC2.C1 -> "OK"
|
||||
SC2.O1 -> "OK"
|
||||
SC2.Removed -> "FAIL4"
|
||||
is SC2.C2 -> "FAIL5"
|
||||
SC2.O2 -> "FAIL6"
|
||||
}
|
||||
|
||||
fun compute(sealedInterface: SI1): String = when (sealedInterface) {
|
||||
is SI1.C1 -> "OK"
|
||||
SI1.O1 -> "OK"
|
||||
is SI1.I1 -> "OK"
|
||||
is SI1.Removed -> "FAIL7"
|
||||
is SI1.C2 -> "FAIL8"
|
||||
SI1.O2 -> "FAIL9"
|
||||
is SI1.I2 -> "FAIL10"
|
||||
}
|
||||
|
||||
fun compute(sealedInterface: SI2): String = when (sealedInterface) {
|
||||
is SI2.C1 -> "OK"
|
||||
SI2.O1 -> "OK"
|
||||
is SI2.I1 -> "OK"
|
||||
SI2.Removed -> "FAIL11"
|
||||
is SI2.C2 -> "FAIL12"
|
||||
SI2.O2 -> "FAIL13"
|
||||
is SI2.I2 -> "FAIL14"
|
||||
}
|
||||
|
||||
fun compute(sealedInterface: SI3): String = when (sealedInterface) {
|
||||
is SI3.C1 -> "OK"
|
||||
SI3.O1 -> "OK"
|
||||
is SI3.I1 -> "OK"
|
||||
is SI3.Removed -> "FAIL15"
|
||||
is SI3.C2 -> "FAIL16"
|
||||
SI3.O2 -> "FAIL17"
|
||||
is SI3.I2 -> "FAIL18"
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,39 @@
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SC1.Removed'")) { compute(SC1.O2) }
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SC1.Removed'")) { compute(SC1.C2()) }
|
||||
expectFailure(linkage("Constructor 'Removed.<init>' can not be called: No constructor found for symbol '/SC1.Removed.<init>'")) { compute(SC1.Removed()) }
|
||||
expectSuccess { compute(SC1.O1) }
|
||||
expectSuccess { compute(SC1.C1()) }
|
||||
|
||||
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SC2.Removed'")) { compute(SC2.O2) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SC2.Removed'")) { compute(SC2.C2()) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SC2.Removed'")) { compute(SC2.Removed) }
|
||||
expectSuccess { compute(SC2.O1) }
|
||||
expectSuccess { compute(SC2.C1()) }
|
||||
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI1.Removed'")) { compute(object : SI1.I2 {}) }
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI1.Removed'")) { compute(SI1.O2) }
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI1.Removed'")) { compute(SI1.C2()) }
|
||||
expectFailure(linkage("Constructor 'Removed.<init>' can not be called: No constructor found for symbol '/SI1.Removed.<init>'")) { compute(SI1.Removed()) }
|
||||
expectSuccess { compute(object : SI1.I1 {}) }
|
||||
expectSuccess { compute(SI1.O1) }
|
||||
expectSuccess { compute(SI1.C1()) }
|
||||
|
||||
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(object : SI2.I2 {}) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(SI2.O2) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(SI2.C2()) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(SI2.Removed) }
|
||||
expectSuccess { compute(object : SI2.I1 {}) }
|
||||
expectSuccess { compute(SI2.O1) }
|
||||
expectSuccess { compute(SI2.C1()) }
|
||||
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI3.Removed'")) { compute(object : SI3.I2 {}) }
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI3.Removed'")) { compute(SI3.O2) }
|
||||
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI3.Removed'")) { compute(SI3.C2()) }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object uses unlinked class symbol '/SI3.Removed'")) { compute(object : SI3.Removed {}) }
|
||||
expectSuccess { compute(object : SI3.I1 {}) }
|
||||
expectSuccess { compute(SI3.O1) }
|
||||
expectSuccess { compute(SI3.C1()) }
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1
|
||||
Reference in New Issue
Block a user