Implement tests map generator and refactor folder structure to spec tests linking

This commit is contained in:
victor.petukhov
2019-08-19 11:26:12 +03:00
parent 28da325a11
commit cf692fb257
217 changed files with 2827 additions and 1787 deletions
@@ -0,0 +1,33 @@
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-draft
* PLACE: expressions, when-expression -> paragraph 5 -> sentence 1
* NUMBER: 1
* DESCRIPTION: 'When' without bound value and with 'else' branch not in the last position.
*/
// TESTCASE NUMBER: 1
fun case_1(<!UNUSED_PARAMETER!>value_1<!>: Int): String = when {
<!ELSE_MISPLACED_IN_WHEN!>else<!> -> ""
<!UNREACHABLE_CODE!>value_1 == 1 -> ""<!>
}
// TESTCASE NUMBER: 2
fun case_2(value_1: Int): String = when {
value_1 == 1 -> ""
<!ELSE_MISPLACED_IN_WHEN!>else<!> -> ""
<!UNREACHABLE_CODE!>value_1 == 2 -> ""<!>
}
// TESTCASE NUMBER: 3
fun case_3(): String {
when {
<!ELSE_MISPLACED_IN_WHEN!>else<!> -> return ""
<!UNREACHABLE_CODE!>else -> return ""<!>
}
<!UNREACHABLE_CODE!>return ""<!>
}
@@ -0,0 +1,26 @@
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-draft
* PLACE: expressions, when-expression -> paragraph 5 -> sentence 1
* NUMBER: 1
* DESCRIPTION: 'When' without bound value and with else branch in the last position.
*/
// TESTCASE NUMBER: 1
fun case_1(value_1: Int): String {
when {
value_1 == 1 -> return ""
value_1 == 2 -> return ""
else -> return ""
}
}
// TESTCASE NUMBER: 2
fun case_2(value_1: Int): String = when {
value_1 == 1 -> ""
value_1 == 2 -> ""
else -> ""
}