[Spec tests] Fix tests

This commit is contained in:
anastasiia.spaseeva
2020-01-09 17:06:30 +03:00
parent 7dc469b32d
commit 94c008872e
12 changed files with 644 additions and 650 deletions
@@ -1,3 +1,4 @@
// !LANGUAGE: +NewInference
// WITH_RUNTIME
/*
@@ -6,14 +7,14 @@
* SPEC VERSION: 0.1-213
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1
* NUMBER: 1
* DESCRIPTION: todo
* DESCRIPTION: check kotlin.Nothing by throwing the exception
*/
fun foo(): Nothing {
throw Exception()
}
fun box() {
fun box(): String {
try {
foo()
} catch (e: Exception) {
@@ -5,6 +5,7 @@
*
* SPEC VERSION: 0.1-213
* PLACE: expressions, built-in-types-and-their-semantics, kotlin.unit -> paragraph 1 -> sentence 1
* RELEVANT PLACES: expressions, equality-expressions, reference-equality-expressions -> paragraph 1 -> sentence 2
* NUMBER: 1
* DESCRIPTION: todo
*/
@@ -20,7 +21,7 @@ fun foo2(): Unit {
fun foo3(): Unit {
}
fun box(){
fun box(): String {
val u1 = foo1()
val u2 = foo2()
val u3 = foo3()
@@ -6,16 +6,16 @@
* SPEC VERSION: 0.1-213
* PLACE: type-system, type-kinds, built-in-types, kotlin.nothing -> paragraph 1 -> sentence 1
* NUMBER: 2
* DESCRIPTION: todo
* DESCRIPTION: check the allowance of returning Nothing where String is expected
*/
fun foo(s: String?): String {
val data = s ?: throw IllegalArgumentException("not null string is expected");
return s ?: throw IllegalArgumentException("not null string is expected");
}
fun box() {
val result = "NOK"
fun box(): String {
var result = "NOK"
val b = foo("")
try {
val a = foo(null)
@@ -5,7 +5,7 @@
{
"specVersion": "0.1-213",
"casesNumber": 0,
"description": "todo",
"description": "check the allowance of returning Nothing where String is expected",
"unexpectedBehaviour": false
},
{