[Spec tests] Updating tests for kotlin 1.4.0

This commit is contained in:
anastasiia.spaseeva
2019-12-02 17:20:28 +03:00
committed by Victor Petukhov
parent ab3b63c92a
commit 1caafdc9d4
46 changed files with 707 additions and 833 deletions
@@ -117,12 +117,16 @@ fun case_8(value_1: Int, value_2: Int) = when (value_1) {
else "4"
}
// TESTCASE NUMBER: 9
/*
* TESTCASE NUMBER: 9
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-37249
*/
fun case_9(value_1: Int, value_2: String, value_3: String): Any {
return when (value_1) {
1 -> try { 4 } catch (e: Exception) { 5 }
2 -> try { throw Exception() } catch (e: Exception) { value_2 }
else -> try { throw Exception() } catch (e: Exception) { {value_3} } finally { }
else -> try { throw Exception() } catch (e: Exception) <!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>{ {<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>value_3<!>} }<!> finally { }
}
}
@@ -1,12 +1,12 @@
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 5 -> sentence 1
* NUMBER: 1
* DESCRIPTION: 'When' with bound value and not allowed break and continue expression (without labels) in the control structure body.
* NUMBER: 2
* DESCRIPTION: 'When' with bound value and allowed break and continue expression (without labels) in the control structure body.
*/
// TESTCASE NUMBER: 1
@@ -14,7 +14,7 @@ fun case_1(value_1: Int): Int {
while (true) {
when (value_1) {
1 -> return 1
2 -> <!BREAK_OR_CONTINUE_IN_WHEN!>break<!>
2 -> break
}
}
@@ -25,7 +25,7 @@ fun case_1(value_1: Int): Int {
fun case_2(value_1: Int): Int {
while (true) {
when (value_1) {
1 -> <!BREAK_OR_CONTINUE_IN_WHEN!>continue<!>
1 -> continue
2 -> return 1
}
}