[Spec tests] Add spec tests for kotlin.Nothing, kotlin.Unit, reference equality and cast expressions
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 10
|
||||
* DESCRIPTION: ckeck a common type of String and Nothing is String
|
||||
*/
|
||||
|
||||
|
||||
fun box(): String {
|
||||
var name: Any? = null
|
||||
val men = arrayListOf(Man("Phill"), Man())
|
||||
loop@ for (i in men) {
|
||||
name = i.name ?: break@loop
|
||||
}
|
||||
if (name is String?) return "OK"
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
private class Man(var name: String? = null) {}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
exit()
|
||||
} catch (e: NullPointerException) {
|
||||
return "OK"
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
fun exit(): Nothing = null!!
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val bar = ::exit
|
||||
try {
|
||||
bar()
|
||||
} catch (e: NotImplementedError) {
|
||||
return "OK"
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
|
||||
private fun exit(): Nothing = TODO()
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 4
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
|
||||
fun box(): String {
|
||||
val bar = ::exit
|
||||
try {
|
||||
bar(enter())
|
||||
} catch (e: NotImplementedError) {
|
||||
return "OK"
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
|
||||
private fun exit(x: () -> Any?): Nothing = throw Exception(x().toString())
|
||||
private fun enter(): Nothing = TODO()
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 5
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
|
||||
fun box(): String {
|
||||
val person = Person("Elvis")
|
||||
person.name
|
||||
try {
|
||||
person.name = null
|
||||
person.name ?: throwException("Name is required")
|
||||
} catch (e: IllegalArgumentException) {
|
||||
return "OK"
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
class Person(var name: String?) {}
|
||||
|
||||
fun throwException(m: String): Nothing {
|
||||
throw IllegalArgumentException(m)
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 6
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
|
||||
fun box(): String {
|
||||
val info = Info<String>()
|
||||
info.getData { "text " }
|
||||
val infoUseless = InfoUseless()
|
||||
try {
|
||||
infoUseless.getData { throw IllegalArgumentException() }
|
||||
} catch (e: IllegalArgumentException) {
|
||||
return "OK"
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
interface Infoable<T> {
|
||||
fun getData(d: () -> T): T
|
||||
}
|
||||
|
||||
open class Info<T : CharSequence> : Infoable<T> {
|
||||
override fun getData(d: () -> T): T {
|
||||
return d()
|
||||
}
|
||||
}
|
||||
|
||||
class InfoUseless : Info<Nothing>() {}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 7
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
import java.util.*
|
||||
|
||||
fun box() : String{
|
||||
val deque1 = ArrayDeque<Any>()
|
||||
val deque2 = ArrayDeque<Any>()
|
||||
deque1.add { throw IllegalArgumentException() }
|
||||
deque1.add { throw NullPointerException() }
|
||||
deque1.add { TODO() }
|
||||
move(deque1, deque2)
|
||||
val v = deque2.first as () -> Nothing
|
||||
try {
|
||||
v.invoke()
|
||||
} catch (e: NotImplementedError) {
|
||||
return "OK"
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
fun <T> move(from: ArrayDeque<out T>, to: ArrayDeque<in T>) {
|
||||
to.add(from.last())
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 8
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val c = Class()
|
||||
try {
|
||||
val a: () -> Nothing = c.data
|
||||
a.invoke()
|
||||
} catch (e: IllegalArgumentException) {
|
||||
try {
|
||||
val d: () -> Nothing = c.value
|
||||
d()
|
||||
} catch (e: NotImplementedError) {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
open class Class() {
|
||||
var data: () -> Nothing = { throwException("data") as Nothing }
|
||||
val value: () -> Nothing
|
||||
get() = { TODO() as Nothing }
|
||||
}
|
||||
|
||||
private fun throwException(m: String): Any {
|
||||
throw IllegalArgumentException(m)
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 9
|
||||
* DESCRIPTION:
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
val city = City()
|
||||
} catch (e: NotImplementedError) {
|
||||
val city = City("", 1)
|
||||
|
||||
city.country
|
||||
try {
|
||||
city.lakeConsumer()
|
||||
} catch (e: NotImplementedError) {
|
||||
try {
|
||||
city.streetsConsumer.stream().forEach { street -> street.invoke() }
|
||||
} catch (e: IllegalArgumentException) {
|
||||
try {
|
||||
val city = City("", 2) { "lake" }
|
||||
city.streetsConsumer[3].invoke()
|
||||
} catch (e: UnsupportedOperationException) {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
class City(val name: String = "", val index: Any = TODO()) {
|
||||
var country: String = "Rus"
|
||||
var lakeConsumer: () -> String
|
||||
var streetsConsumer: MutableList<() -> String>
|
||||
|
||||
init {
|
||||
lakeConsumer = { TODO() }
|
||||
streetsConsumer = mutableListOf({ "x" }, { "y" }, { throw IllegalArgumentException() })
|
||||
}
|
||||
|
||||
constructor(name: String, index: Any, lakeConsumer: () -> String) : this(name, index) {
|
||||
this.lakeConsumer = lakeConsumer
|
||||
this.streetsConsumer.add { throw UnsupportedOperationException() }
|
||||
}
|
||||
}
|
||||
+55
-1
@@ -5,7 +5,61 @@
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "todo",
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "ckeck a common type of String and Nothing is String",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "check kotlin.Nothing by throwing the exception",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
]
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, cast-expression -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: check of the cast operators as or as?
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val c = Class()
|
||||
if (c.data !is () -> Nothing) return "NOK"
|
||||
val e1 : () -> Nothing = c.exception as () -> Nothing as? () -> Nothing ?: return "NOK"
|
||||
val v = c.value as () -> Nothing as? () -> Nothing ?: return "NOK"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
open class Class() {
|
||||
var data: () -> Nothing = { throwException("boo") as Nothing }
|
||||
var exception: () -> CharSequence = { throwException("foo") as String }
|
||||
val value: () -> Any
|
||||
get() = { TODO() as Nothing }
|
||||
}
|
||||
|
||||
private fun throwException(m: String): Any {
|
||||
throw IllegalArgumentException(m)
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"1": {
|
||||
"pos": {
|
||||
"1": [
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": " check of the cast operators as or as?",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 2
|
||||
* RELEVANT PLACES: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: check if two values are equal (===) by reference
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val u1 = foo1()
|
||||
val u2 = foo2()
|
||||
if (u1 === u2) {
|
||||
return ("OK")
|
||||
}
|
||||
return ("NOK")
|
||||
}
|
||||
|
||||
fun foo1() {
|
||||
return Unit
|
||||
}
|
||||
|
||||
fun foo2(): Unit {
|
||||
return Unit
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 2
|
||||
* RELEVANT PLACES: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1,
|
||||
* expressions, equality-expressions, reference-equality-expressions -> paragraph 3 -> sentence 3
|
||||
* expressions, equality-expressions, reference-equality-expressions -> paragraph 2 -> sentence 1
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: check if two values are equal (===) by reference
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val u1 = "foo"
|
||||
val u2 = "foo"
|
||||
if (u1 === u2) {
|
||||
return ("OK")
|
||||
}
|
||||
return ("NOK")
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 2
|
||||
* RELEVANT PLACES: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: check if two values are non-equal (!==) by reference
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val u1 = "boo"
|
||||
val u2 = "foo"
|
||||
if (u1 !== u2) {
|
||||
return ("OK")
|
||||
}
|
||||
return ("NOK")
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 2
|
||||
* RELEVANT PLACES: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 4
|
||||
* DESCRIPTION: check if values are non-equal (!==) by reference
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val u1 = "foo"
|
||||
val byteArray = "foo".toByteArray(Charsets.UTF_8)
|
||||
val u2 = byteArray.toString()
|
||||
val u3 = byteArray.toString()
|
||||
if (u1 !== u2 && u1 !== u3 && u2 !== u3 &&
|
||||
u2 !== u1 && u3 !== u1 && u3 !== u2
|
||||
) {
|
||||
return ("OK")
|
||||
}
|
||||
return ("NOK")
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 2
|
||||
* RELEVANT PLACES: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 5
|
||||
* DESCRIPTION: two values are equal (===) or non-equal (!==) by reference
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val c1 = c
|
||||
val c2 = c
|
||||
val v1 = v
|
||||
val v2 = v
|
||||
if (c2 === c1 && c1 === c2 && c1 === c && c2 === c &&
|
||||
v2 === v1 && v1 === v2 && v1 === v && v2 === v &&
|
||||
v2 === c1 && v1 === c2 && v1 === c && v2 === c &&
|
||||
c2 === v1 && c1 === v2 && c1 === v && c2 === v
|
||||
) {
|
||||
return ("OK")
|
||||
}
|
||||
return ("NOK")
|
||||
}
|
||||
|
||||
const val c = 1000
|
||||
const val v = 1000
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 3
|
||||
* RELEVANT PLACES: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: check equallity by refference via constructor
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val u2 = mutableListOf<Int>(1, 2, 3)
|
||||
val u3 = u1
|
||||
if (u1 !== u2 && u1 === u3
|
||||
) {
|
||||
return ("OK")
|
||||
}
|
||||
return ("NOK")
|
||||
}
|
||||
|
||||
val u1 = mutableListOf<Int>(1, 2, 3)
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, type-checking-and-containment-checking-expressions, type-checking-expression -> paragraph 1 -> sentence 3
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION:checks whether the runtime type of E is not a subtype of T for !is operator.
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val bar = ::boo
|
||||
val bar1 = ::exit
|
||||
if (bar !is () -> Nothing && bar1 !is (Nothing) -> Nothing) return "NOK"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
private fun boo(): Nothing = TODO()
|
||||
private fun exit(x: () -> Any?): Nothing = throw Exception(x().toString())
|
||||
private fun enter(): Nothing = TODO()
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, type-checking-and-containment-checking-expressions, type-checking-expression -> paragraph 1 -> sentence 3
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION:checks whether the runtime type of EE is a subtype of TT for is operator
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val bar = ::boo
|
||||
val bar1 = ::exit
|
||||
|
||||
if (bar is () -> Nothing && bar1 is (Nothing) -> Nothing) return "OK"
|
||||
|
||||
return "NOK"
|
||||
}
|
||||
|
||||
private fun boo(): Nothing = TODO()
|
||||
private fun exit(x: () -> Any?): Nothing = throw Exception(x().toString())
|
||||
private fun enter(): Nothing = TODO()
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"1": {
|
||||
"pos": {
|
||||
"3": [
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "checks whether the runtime type of E is not a subtype of T for !is operator.",
|
||||
"unexpectedBehaviour": false
|
||||
},
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 0,
|
||||
"description": "checks whether the runtime type of EE is a subtype of TT for is operator",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-4
@@ -9,11 +9,10 @@
|
||||
* DESCRIPTION: todo
|
||||
*/
|
||||
|
||||
fun box() {
|
||||
val b : Any? = null
|
||||
fun box(): String {
|
||||
val b : Nothing?= null
|
||||
try {
|
||||
val a: Int
|
||||
a = b!!
|
||||
val a: Int = b!!
|
||||
} catch (e: NullPointerException) {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: check the type of jump expressions is Nothing and code placed on the left side of expression will never be executed
|
||||
*/
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
fun case1() {
|
||||
var name: Any? = null
|
||||
val men = arrayListOf(Person("Phill"), Person(), Person("Bob"))
|
||||
for (k in men) {
|
||||
k.name
|
||||
loop@ for (i in men) {
|
||||
i.name
|
||||
<!UNREACHABLE_CODE!>val valeua : Int =<!> break@loop
|
||||
<!UNREACHABLE_CODE!>i.name<!>
|
||||
}
|
||||
k.name
|
||||
val s = k.name ?: break
|
||||
k.name
|
||||
}
|
||||
val a = 1
|
||||
}
|
||||
|
||||
class Person(var name: String? = null) {}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
fun case2() {
|
||||
var name: Any? = null
|
||||
val men = arrayListOf(Person("Phill"), Person(), Person("Bob"))
|
||||
for (k in men) {
|
||||
loop@ for (i in men) {
|
||||
i.name
|
||||
<!UNREACHABLE_CODE!>val val1 =<!> continue@loop
|
||||
<!UNREACHABLE_CODE!>val1<!>
|
||||
<!UNREACHABLE_CODE!>i.name<!>
|
||||
}
|
||||
val s = k.name ?: continue
|
||||
k.name
|
||||
}
|
||||
val a = 1
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
|
||||
fun case3() {
|
||||
listOf(1, 2, 3, 4, 5).forEach { x ->
|
||||
val k = x
|
||||
|
||||
listOf(1, 2, 3, 4, 5).forEach lit@{
|
||||
it
|
||||
return@lit
|
||||
<!UNREACHABLE_CODE!>print(it)<!>
|
||||
}
|
||||
val y = x
|
||||
if (x == 3) return
|
||||
}
|
||||
val a = 1
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"1": {
|
||||
"pos": {
|
||||
"1": [
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 3,
|
||||
"description": "check the type of jump expressions is Nothing and code placed on the left side of expression will never be executed",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+57
@@ -0,0 +1,57 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -UNREACHABLE_CODE
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-213
|
||||
* PLACE: expressions, jump-expressions -> paragraph 2 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: check he type of jump expressions is the kotlin.Nothing
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
fun case1() {
|
||||
var name: Any? = null
|
||||
val men = arrayListOf(Person("Phill"), Person(), Person("Bob"))
|
||||
for (k in men) {
|
||||
k.name
|
||||
loop@ for (i in men) {
|
||||
val val1: Int = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>break@loop<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>val1<!>
|
||||
}
|
||||
val s = k.name ?: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>break<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>s<!>
|
||||
}
|
||||
}
|
||||
|
||||
class Person(var name: String? = null) {}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
|
||||
fun case2() {
|
||||
var name: Any? = null
|
||||
val men = arrayListOf(Person("Phill"), Person(), Person("Bob"))
|
||||
for (k in men) {
|
||||
loop@ for (i in men) {
|
||||
val val1 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>continue@loop<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>val1<!>
|
||||
}
|
||||
val s = k.name ?: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>continue<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>s<!>
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
|
||||
fun case3() {
|
||||
listOf(1, 2, 3, 4, 5).forEach { x ->
|
||||
listOf(1, 2, 3, 4, 5).forEach lit@{
|
||||
val s = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>return@lit<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>s<!>
|
||||
}
|
||||
if (x == 3) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>return<!>
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"2": {
|
||||
"pos": {
|
||||
"1": [
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 3,
|
||||
"description": "check he type of jump expressions is the kotlin.Nothing",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -1,4 +1,5 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -UNREACHABLE_CODE
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
@@ -16,5 +17,16 @@
|
||||
class Case1(val nothing: Nothing)
|
||||
|
||||
fun case1() {
|
||||
val res = Case1(Nothing())
|
||||
val res = Case1(<!INVISIBLE_MEMBER!>Nothing<!>())
|
||||
}
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
class Case2 {
|
||||
var data: String? = null
|
||||
}
|
||||
|
||||
fun case2(c: Case2) {
|
||||
val testValue = c.data ?: throw IllegalArgumentException("data required")
|
||||
testValue checkType { <!NONE_APPLICABLE!>check<!><Nothing>() }
|
||||
}
|
||||
+13
-7
@@ -1,4 +1,6 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -UNREACHABLE_CODE
|
||||
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
@@ -8,26 +10,30 @@
|
||||
* PLACE: type-system, type-kinds, built-in-types, kotlin.nothing -> paragraph 1 -> sentence 1
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Check of Nothing type is a subtype of any types
|
||||
* HELPERS: checkType
|
||||
* HELPERS: checkType, functions
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class NothingWrapper() {
|
||||
val data: Nothing
|
||||
val data: Nothing = TODO()
|
||||
}
|
||||
|
||||
class CustomClass
|
||||
class CustomClass() {}
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case1(wrapper: NothingWrapper) {
|
||||
fun case1() {
|
||||
val wrapper: NothingWrapper = NothingWrapper()
|
||||
checkSubtype<Any>(wrapper.data)
|
||||
checkSubtype<Any>(wrapper.data)
|
||||
|
||||
checkSubtype<Any>(wrapper.data)
|
||||
checkSubtype<Function<Nothing>>(wrapper.data)
|
||||
checkSubtype<Int>(wrapper.data)
|
||||
checkSubtype<Short>(wrapper.data)
|
||||
checkSubtype<Byte>(wrapper.data)
|
||||
checkSubtype<Long>(wrapper.data)
|
||||
checkSubtype<kotlin.Array>(wrapper.data)
|
||||
checkSubtype<kotlin.Array<Any>>(wrapper.data)
|
||||
checkSubtype<CustomClass>(wrapper.data)
|
||||
}
|
||||
|
||||
@@ -35,10 +41,10 @@ fun case1(wrapper: NothingWrapper) {
|
||||
fun case2(wrapper: NothingWrapper) {
|
||||
checkSubtype<MutableList<out Nothing>>(wrapper.data)
|
||||
checkSubtype<MutableList<in String>>(wrapper.data)
|
||||
checkSubtype<MutableList<out CustomClass>>(wrapper.data)
|
||||
checkSubtype<MutableList<in CustomClass>>(wrapper.data)
|
||||
checkSubtype<MutableList<Any?>>(wrapper.data)
|
||||
|
||||
checkSubtype<String>(wrapper.data)
|
||||
|
||||
checkSubtype<in CustomClass>(wrapper.data)
|
||||
checkSubtype<out CustomClass>(wrapper.data)
|
||||
}
|
||||
+8
-17
@@ -1,4 +1,5 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -UNREACHABLE_CODE
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
@@ -8,11 +9,11 @@
|
||||
* PLACE: type-system, type-kinds, built-in-types, kotlin.nothing -> paragraph 1 -> sentence 2
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Check of Nothing as a subtype of any type
|
||||
* HELPERS: checkType
|
||||
* HELPERS: checkType, functions
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
class Case1() {
|
||||
class Case1 {
|
||||
val data: Nothing = TODO()
|
||||
}
|
||||
|
||||
@@ -21,26 +22,16 @@ fun case1(c: Case1) {
|
||||
checkSubtype<Function<Nothing>>(c.data)
|
||||
}
|
||||
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
class Case2 {
|
||||
var data: String
|
||||
}
|
||||
|
||||
fun case2(c: Case2) {
|
||||
val testValue = c.data ?: throw IllegalArgumentException("data required")
|
||||
testValue checkType { check<Nothing>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
class Case3 {
|
||||
val dataFunction = fail("fail msg")
|
||||
val dataFunction: Nothing = fail("fail msg")
|
||||
}
|
||||
|
||||
fun fail(msg: String): Nothing {
|
||||
throw new Exception (msg)
|
||||
throw Exception(msg)
|
||||
}
|
||||
|
||||
fun case3(c: Case3) {
|
||||
val testValue = c.dataFunction()
|
||||
checkType<Nothing>(testValue)
|
||||
fun case2(c: Case2) {
|
||||
c.dataFunction checkType { check<Nothing>() }
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
"2": [
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 1,
|
||||
"casesNumber": 2,
|
||||
"description": "Check of Nothing type",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
"2": [
|
||||
{
|
||||
"specVersion": "0.1-213",
|
||||
"casesNumber": 3,
|
||||
"casesNumber": 2,
|
||||
"description": "Check of Nothing as a subtype of any type",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
|
||||
Generated
+409
@@ -153,6 +153,196 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Built_in_types_and_their_semantics extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBuilt_in_types_and_their_semantics() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Kotlin_nothing_1 extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKotlin_nothing_1() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class P_1 extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInP_1() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Pos extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("1.1.kt")
|
||||
public void test1_1() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.10.kt")
|
||||
public void test1_10() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.10.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.2.kt")
|
||||
public void test1_2() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.3.kt")
|
||||
public void test1_3() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.4.kt")
|
||||
public void test1_4() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.4.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.5.kt")
|
||||
public void test1_5() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.5.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.6.kt")
|
||||
public void test1_6() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.6.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.7.kt")
|
||||
public void test1_7() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.7.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.8.kt")
|
||||
public void test1_8() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.8.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.9.kt")
|
||||
public void test1_9() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.9.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPos() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.unit")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Kotlin_unit extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKotlin_unit() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.unit"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class P_1 extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInP_1() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Pos extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("1.1.kt")
|
||||
public void test1_1() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos/1.1.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPos() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Cast_expression extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCast_expression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class P_1 extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInP_1() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1/pos")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Pos extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("1.1.kt")
|
||||
public void test1_1() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1/pos/1.1.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPos() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/constant-literals")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -745,6 +935,150 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Equality_expressions extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInEquality_expressions() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Reference_equality_expressions extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInReference_equality_expressions() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class P_1 extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInP_1() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Pos extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("2.1.kt")
|
||||
public void test2_1() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos/2.1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("2.2.kt")
|
||||
public void test2_2() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos/2.2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("2.3.kt")
|
||||
public void test2_3() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos/2.3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("2.4.kt")
|
||||
public void test2_4() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos/2.4.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("2.5.kt")
|
||||
public void test2_5() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos/2.5.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("3.1.kt")
|
||||
public void test3_1() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos/3.1.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPos() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/equality-expressions/reference-equality-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Type_checking_and_containment_checking_expressions extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInType_checking_and_containment_checking_expressions() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Type_checking_expression extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInType_checking_expression() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class P_1 extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInP_1() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-1/pos")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Pos extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("3.1.kt")
|
||||
public void test3_1() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-1/pos/3.1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("3.2.kt")
|
||||
public void test3_2() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-1/pos/3.2.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPos() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/type-system")
|
||||
@@ -877,6 +1211,81 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Type_kinds extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInType_kinds() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Built_in_types extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBuilt_in_types() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Kotlin_nothing extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKotlin_nothing() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class P_1 extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInP_1() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Pos extends AbstractBlackBoxCodegenTestSpec {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
@TestMetadata("1.1.kt")
|
||||
public void test1_1() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("1.2.kt")
|
||||
public void test1_2() throws Exception {
|
||||
runTest("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.2.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPos() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user