[Spec tests] Review fix tests for try-expression and if-expression

This commit is contained in:
anastasiia.spaseeva
2019-12-16 17:19:52 +03:00
parent e865327386
commit bd979a12de
21 changed files with 765 additions and 35 deletions
@@ -0,0 +1,15 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-218
* PLACE: expressions, conditional-expression -> paragraph 1 -> sentence 2
* NUMBER: 1
* DESCRIPTION: if-expression: check the correct branch is evaluating
*/
fun box(): String {
if (true) return "OK" else "false branch"
return "NOK"
}
@@ -0,0 +1,16 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-218
* PLACE: expressions, conditional-expression -> paragraph 1 -> sentence 2
* NUMBER: 2
* DESCRIPTION: if-expression: check the correct branch is evaluating
*/
fun box(): String {
if (false) "true" else return "OK"
return "NOK"
}
@@ -0,0 +1,17 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-218
* PLACE: expressions, conditional-expression -> paragraph 1 -> sentence 2
* RELEVANT PLACES: expressions, conditional-expression -> paragraph 4 -> sentence 2
* NUMBER: 3
* DESCRIPTION: if-expression: check the correct branch is evaluating
*/
fun box(): String {
if (false) return "NOK"
return "OK"
}
@@ -0,0 +1,16 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-218
* PLACE: expressions, conditional-expression -> paragraph 1 -> sentence 2
* NUMBER: 4
* DESCRIPTION: if-expression: check the correct branch is evaluating
*/
fun box(): String {
if (false) else return "OK"
return "NOK"
}
@@ -0,0 +1,15 @@
// WITH_RUNTIME
/*
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-218
* PLACE: expressions, conditional-expression -> paragraph 2 -> sentence 1
* NUMBER: 1
* DESCRIPTION:
*/
fun box(): String {
if (true) else;
return "OK"
}
@@ -0,0 +1,57 @@
{
"1": {
"pos": {
"2": [
{
"specVersion": "0.1-218",
"casesNumber": 0,
"description": "if-expression: check the correct branch is evaluating",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-218",
"casesNumber": 0,
"description": "if-expression: check the correct branch is evaluating",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-218",
"casesNumber": 0,
"description": "if-expression: check the correct branch is evaluating",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-218",
"casesNumber": 0,
"description": "if-expression: check the correct branch is evaluating",
"unexpectedBehaviour": false
}
]
}
},
"4": {
"pos": {
"2": [
{
"specVersion": "0.1-218",
"casesNumber": 0,
"description": "if-expression: check the correct branch is evaluating",
"path": "compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.3.kt",
"unexpectedBehaviour": false
}
]
}
},
"2": {
"pos": {
"1": [
{
"specVersion": "0.1-218",
"casesNumber": 0,
"description": "",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -15,7 +15,6 @@ fun box(): String {
var isTryExecuted = false
var isCatched = false
var isFinallyExecuted = false
var isExecutedFully = false
try {
isTryExecuted = true
} catch (e: Exception) {
@@ -23,7 +22,6 @@ fun box(): String {
} finally {
isFinallyExecuted = true
}
isExecutedFully = true
return if (isTryExecuted && !isCatched && isFinallyExecuted && isExecutedFully) "OK"
return if (isTryExecuted && !isCatched && isFinallyExecuted) "OK"
else "NOK"
}
@@ -16,7 +16,6 @@ fun box(): String {
var isTryExecuted = false
var isCatched = false
var isFinallyExecuted = false
var isExecutedFully = false
try {
isTryExecuted = true
throwException(true)
@@ -25,7 +24,6 @@ fun box(): String {
} finally {
isFinallyExecuted = true
}
isExecutedFully = true
return if (isTryExecuted &&isCatched && isFinallyExecuted && isExecutedFully) "OK"
return if (isTryExecuted &&isCatched && isFinallyExecuted) "OK"
else "NOK"
}
@@ -19,7 +19,6 @@ fun box(): String {
var isTryExecuted = false
var isCatched = false
var isFinallyExecuted = false
var isExecutedFully = false
var isTryExpressionPropagated = false
try {
@@ -35,12 +34,10 @@ fun box(): String {
isTryExpressionPropagated = true
}
isExecutedFully = true
return if (isTryExecuted &&
!isCatched &&
isFinallyExecuted &&
isTryExpressionPropagated &&
isExecutedFully
isTryExpressionPropagated
) "OK"
else "NOK"
}
@@ -1,5 +1,5 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// !DIAGNOSTICS: -IMPLICIT_CAST_TO_ANY -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
/*
@@ -0,0 +1,32 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -IMPLICIT_CAST_TO_ANY -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-213
* PLACE: control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
* NUMBER: 2
* DESCRIPTION: check if-expressions must have both branches.
*/
// TESTCASE NUMBER: 1
fun case1() {
val b = true
val c = true
val a = if (b) {
"first true"
} else <!INVALID_IF_AS_EXPRESSION!>if<!> (c) {
"else if true"
}
}
// TESTCASE NUMBER: 2
fun case2() {
var b = true
val c = true
val a = if (b) 1 else <!INVALID_IF_AS_EXPRESSION!>if<!> (c) 2 else ;
}
@@ -0,0 +1,83 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNREACHABLE_CODE -IMPLICIT_CAST_TO_ANY -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-213
* PLACE: control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
* NUMBER: 3
* DESCRIPTION: check if-expressions must have both branches. (attempt to pass Nothing to if-condition without 'else' key word)
*/
fun throwExc(b: Boolean): Boolean {
if (b) throw Exception()
else return false
}
// TESTCASE NUMBER: 1
fun case1() {
val x1 = <!INVALID_IF_AS_EXPRESSION!>if<!> (throwExc(false)) true
}
// TESTCASE NUMBER: 3
fun case3() {
val x1 = <!INVALID_IF_AS_EXPRESSION!>if<!> (throwExc(true)) true
}
/*
* TESTCASE NUMBER: 4
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35510
*/
fun case4() {
val x1 = if (throw Exception()) true
val x2 = if (TODO()) true
val x0 = if (false) true else if (throw Exception()) ;
}
// TESTCASE NUMBER: 5
fun case5() {
var flag: Boolean? = null
val x1 = <!INVALID_IF_AS_EXPRESSION!>if<!> (flag ?: throw Exception()) true
}
/*
* TESTCASE NUMBER: 6
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35510
*/
fun case6() {
val k1 = if(throw Exception());
}
/*
* TESTCASE NUMBER: 7
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35510
*/
fun case7(nothing: Nothing) {
val k1 = if(throw Exception())
<!SYNTAX!><!>}
/*
* TESTCASE NUMBER: 8
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35510
*/
fun case8(nothing: Nothing) {
val x1 = if (nothing) true
}
/*
* TESTCASE NUMBER: 9
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35510
*/fun case9() {
val k1 = if(throw Exception())
<!SYNTAX!><!>}
@@ -0,0 +1,48 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNREACHABLE_CODE -IMPLICIT_CAST_TO_ANY -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-213
* PLACE: control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
* NUMBER: 4
* DESCRIPTION: check if-expressions must have both branches. (attempt to pass Nothing to if-condition with 'else' key word)
*/
// TESTCASE NUMBER: 1
fun case1() {
val y0else = <!INVALID_IF_AS_EXPRESSION!>if<!> (false) true else ;
}
/*
* TESTCASE NUMBER: 2
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35510
*/
fun case2(nothing: Nothing) {
val n1else = if (nothing) true else;
}
/*
* TESTCASE NUMBER: 3
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35510
*/
fun case3(nothing: Nothing) {
val n1else = if (nothing) true else
<!SYNTAX!><!>}
// TESTCASE NUMBER: 4
fun case4(nothing: Nothing) {
val x = <!INVALID_IF_AS_EXPRESSION!>if<!> (false) else if (nothing) { "foo"} else
<!SYNTAX!><!>}
// TESTCASE NUMBER: 5
fun case5(nothing: Nothing) {
val x = <!INVALID_IF_AS_EXPRESSION!>if<!> (false) else if (nothing) { "foo"} else ;
}
@@ -0,0 +1,34 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -IMPLICIT_CAST_TO_ANY -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -DEBUG_INFO_SMARTCAST
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-213
* PLACE: control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
* NUMBER: 2
* DESCRIPTION: check if-expressions must have both branches.
* HELPERS: checkType
*/
// TESTCASE NUMBER: 1
fun case1() {
val b = true
val c = true
val a = if (b) {
"first true"
} else if (c) {
"else if true"
} else {}
}
// TESTCASE NUMBER: 2
fun case2() {
var b = true
val c = true
val a = if (b) 1 else if (c) 2 else Unit;
}
@@ -10,6 +10,24 @@
}
],
"1": [
{
"specVersion": "0.1-213",
"casesNumber": 2,
"description": "check if-expressions must have both branches.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-213",
"casesNumber": 8,
"description": "check if-expressions must have both branches. (attempt to pass Nothing to if-condition without \u0027else\u0027 key word)",
"unexpectedBehaviour": true
},
{
"specVersion": "0.1-213",
"casesNumber": 5,
"description": "check if-expressions must have both branches. (attempt to pass Nothing to if-condition with \u0027else\u0027 key word)",
"unexpectedBehaviour": true
},
{
"specVersion": "0.1-213",
"casesNumber": 2,
@@ -28,6 +46,12 @@
}
],
"1": [
{
"specVersion": "0.1-213",
"casesNumber": 2,
"description": "check if-expressions must have both branches.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-213",
"casesNumber": 3,
@@ -0,0 +1,52 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
// FULL_JDK
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-218
* PLACE: expressions, conditional-expression -> paragraph 6 -> sentence 1
* NUMBER: 1
* DESCRIPTION: The type of the condition expression must be a subtype of kotlin.Boolean
* HELPERS: checkType
*/
// MODULE: libModule
// FILE: libModule/JavaContainer.java
package libModule;
public class JavaContainer {
public static boolean ab;
public static final Boolean aB;
public static Object aO = false;
}
// MODULE: mainModule(libModule)
// FILE: KotlinClass.kt
package mainModule
import libModule.*
import checkSubtype
/*
* TESTCASE NUMBER: 1
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35517
*/
fun case1() {
val a: Any = true
if (<!TYPE_MISMATCH, TYPE_MISMATCH!>a<!>) { "true" } else "false"
checkSubtype<Boolean>(<!TYPE_MISMATCH!>a<!>)
}
/*
* TESTCASE NUMBER: 2
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-35517
*/
fun case2() {
val a = JavaContainer.aO
if (<!TYPE_MISMATCH, TYPE_MISMATCH!>a<!>) { "true" } else "false"
checkSubtype<Boolean>(<!TYPE_MISMATCH!>a<!>)
}
@@ -0,0 +1,58 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT
// FULL_JDK
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-218
* PLACE: expressions, conditional-expression -> paragraph 6 -> sentence 1
* NUMBER: 1
* DESCRIPTION: The type of the condition expression must be a subtype of kotlin.Boolean
* HELPERS: checkType
*/
// MODULE: libModule
// FILE: libModule/JavaContainer.java
package libModule;
public class JavaContainer {
public static boolean ab;
public static Boolean aB;
public static final Object aO = false;
}
// MODULE: mainModule(libModule)
// FILE: KotlinClass.kt
package mainModule
import libModule.*
import checkSubtype
// TESTCASE NUMBER: 1
fun case1() {
val a = JavaContainer.ab
if (a) { "true" } else "false"
checkSubtype<Boolean>(a)
checkSubtype<Boolean>(false)
}
// TESTCASE NUMBER: 2
fun case2() {
val a = JavaContainer.aB
if (a) { "true" } else "false"
checkSubtype<Boolean>(a)
}
// TESTCASE NUMBER: 3
fun case3() {
val a = JavaContainer.aO as Boolean
if (a) { "true" } else "false"
checkSubtype<Boolean>(a)
}
// TESTCASE NUMBER: 4
fun case4(a: Nothing) {
checkSubtype<Boolean>(a)
if (a) { "true" } else "false"
}
@@ -0,0 +1,92 @@
{
"6": {
"neg": {
"1": [
{
"specVersion": "0.1-218",
"casesNumber": 2,
"description": "The type of the condition expression must be a subtype of kotlin.Boolean",
"unexpectedBehaviour": true
}
]
},
"pos": {
"1": [
{
"specVersion": "0.1-218",
"casesNumber": 4,
"description": "The type of the condition expression must be a subtype of kotlin.Boolean",
"unexpectedBehaviour": false
}
]
}
},
"4": {
"pos": {
"1": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
}
]
}
},
"5": {
"pos": {
"1": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -145,9 +145,9 @@
"1": [
{
"specVersion": "0.1-218",
"casesNumber": 2,
"casesNumber": 3,
"description": "The type of the try-expression is the least upper bound of the types of the last expressions of the try body and the last expressions of all the catch blocks",
"unexpectedBehaviour": false
"unexpectedBehaviour": true
}
]
},
@@ -162,15 +162,15 @@
]
}
},
"4": {
"9": {
"neg": {
"1": [
{
"specVersion": "0.1-218",
"casesNumber": 2,
"casesNumber": 3,
"description": "The type of the try-expression is the least upper bound of the types of the last expressions of the try body and the last expressions of all the catch blocks",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt",
"unexpectedBehaviour": false
"unexpectedBehaviour": true
}
]
},
@@ -182,20 +182,6 @@
"description": "The type of the try-expression is the least upper bound of the types of the last expressions of the try body and the last expressions of all the catch blocks",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/pos/1.1.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-218",
"casesNumber": 1,
"description": "If an exception was thrown, but no catch block matched its type, the finally block is evaluated before propagating the exception up the call stack.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos/2.1.kt",
"unexpectedBehaviour": true
},
{
"specVersion": "0.1-218",
"casesNumber": 1,
"description": "If no exception is thrown during the evaluation of the try body, no catch blocks are executed, the finally block is evaluated after the try body, and the program execution continues as normal.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos/1.1.kt",
"unexpectedBehaviour": false
}
]
}
@@ -240,5 +226,25 @@
}
]
}
},
"4": {
"pos": {
"1": [
{
"specVersion": "0.1-218",
"casesNumber": 1,
"description": "If an exception was thrown, but no catch block matched its type, the finally block is evaluated before propagating the exception up the call stack.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos/2.1.kt",
"unexpectedBehaviour": true
},
{
"specVersion": "0.1-218",
"casesNumber": 1,
"description": "If no exception is thrown during the evaluation of the try body, no catch blocks are executed, the finally block is evaluated after the try body, and the program execution continues as normal.",
"path": "compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos/1.1.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -25,7 +25,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
public void testAllFilesPresentInDiagnostics() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), true, "helpers", "linked/type-inference", "linked/type-system/type-kinds/type-parameters", "linked/type-system/subtyping", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/annotations", "linked/statements", "linked/inheritance", "linked/expressions/function-literals", "linked/expressions/conditional-expression", "linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/neg", "linked/overload-resolution", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph");
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), true, "helpers", "linked/type-inference", "linked/type-system/type-kinds/type-parameters", "linked/type-system/subtyping", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/function-declaration", "linked/annotations", "linked/statements", "linked/inheritance", "linked/expressions.conditional-expression", "linked/expressions/function-literals", "linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/neg", "linked/overload-resolution", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked")
@@ -37,7 +37,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
public void testAllFilesPresentInLinked() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), true, "type-inference", "type-system/type-kinds/type-parameters", "type-system/subtyping", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "annotations", "statements", "inheritance", "expressions/function-literals", "expressions/conditional-expression", "expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/neg", "overload-resolution", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph");
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), true, "type-inference", "type-system/type-kinds/type-parameters", "type-system/subtyping", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "declarations/classifier-declaration/classifier-initialization", "declarations/function-declaration", "annotations", "statements", "inheritance", "expressions.conditional-expression", "expressions/function-literals", "expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/neg", "overload-resolution", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis")
@@ -113,6 +113,21 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt");
}
@TestMetadata("1.2.kt")
public void test1_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.2.kt");
}
@TestMetadata("1.3.kt")
public void test1_3() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.3.kt");
}
@TestMetadata("1.4.kt")
public void test1_4() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.4.kt");
}
@TestMetadata("2.1.kt")
public void test2_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/2.1.kt");
@@ -136,6 +151,11 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/1.1.kt");
}
@TestMetadata("1.2.kt")
public void test1_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/1.2.kt");
}
@TestMetadata("2.1.kt")
public void test2_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/2.1.kt");
@@ -375,7 +395,7 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
public void testAllFilesPresentInExpressions() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions"), Pattern.compile("^(.+)\\.kt$"), true, "function-literals", "conditional-expression", "built-in-types-and-their-semantics/kotlin.nothing-1/p-1/neg");
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions"), Pattern.compile("^(.+)\\.kt$"), true, "function-literals", "built-in-types-and-their-semantics/kotlin.nothing-1/p-1/neg");
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics")
@@ -479,6 +499,68 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Conditional_expression extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInConditional_expression() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class P_6 extends AbstractDiagnosticsTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInP_6() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Neg extends AbstractDiagnosticsTestSpec {
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/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.kt");
}
public void testAllFilesPresentInNeg() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg"), Pattern.compile("^(.+)\\.kt$"), true);
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Pos extends AbstractDiagnosticsTestSpec {
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/diagnostics/linked/expressions/conditional-expression/p-6/pos/1.1.kt");
}
public void testAllFilesPresentInPos() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos"), Pattern.compile("^(.+)\\.kt$"), true);
}
}
}
}
@TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25,7 +25,7 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes
}
public void testAllFilesPresentInBox() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), true, "helpers", "templates", "linked/statements", "linked/expressions/equality-expressions/reference-equality-expressions/p-1/neg", "linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/neg", "linked/expressions/prefix-expressions/prefix-increment-expression/p-1/neg");
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), true, "helpers", "templates", "linked/statements", "linked/expressions.conditional-expression", "linked/expressions/equality-expressions/reference-equality-expressions/p-1/neg", "linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/neg", "linked/expressions/prefix-expressions/prefix-increment-expression/p-1/neg");
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked")
@@ -37,7 +37,7 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes
}
public void testAllFilesPresentInLinked() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked"), Pattern.compile("^(.+)\\.kt$"), true, "statements", "expressions/equality-expressions/reference-equality-expressions/p-1/neg", "expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/neg", "expressions/prefix-expressions/prefix-increment-expression/p-1/neg");
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked"), Pattern.compile("^(.+)\\.kt$"), true, "statements", "expressions.conditional-expression", "expressions/equality-expressions/reference-equality-expressions/p-1/neg", "expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/neg", "expressions/prefix-expressions/prefix-increment-expression/p-1/neg");
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions")
@@ -242,6 +242,96 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes
}
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Conditional_expression extends AbstractBlackBoxCodegenTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInConditional_expression() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-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/conditional-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-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("2.1.kt")
public void test2_1() throws Exception {
runTest("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/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/conditional-expression/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/conditional-expression/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/conditional-expression/p-1/pos/2.4.kt");
}
public void testAllFilesPresentInPos() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), true);
}
}
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-2")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class P_2 extends AbstractBlackBoxCodegenTestSpec {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInP_2() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-2/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/conditional-expression/p-2/pos/1.1.kt");
}
public void testAllFilesPresentInPos() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), true);
}
}
}
}
@TestMetadata("compiler/tests-spec/testData/codegen/box/linked/expressions/constant-literals")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)