diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.1.kt new file mode 100644 index 00000000000..585d4ec156c --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.1.kt @@ -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" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.2.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.2.kt new file mode 100644 index 00000000000..6652c847254 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.2.kt @@ -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" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.3.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.3.kt new file mode 100644 index 00000000000..707d888a59b --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.3.kt @@ -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" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.4.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.4.kt new file mode 100644 index 00000000000..ca94c897f1a --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-1/pos/2.4.kt @@ -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" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-2/pos/1.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-2/pos/1.1.kt new file mode 100644 index 00000000000..788d9580610 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/p-2/pos/1.1.kt @@ -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" +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/testsMap.json new file mode 100644 index 00000000000..58220a086e7 --- /dev/null +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/conditional-expression/testsMap.json @@ -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 + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/1.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/1.1.kt index 081590a2550..250dedef808 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/1.1.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/1.1.kt @@ -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" } \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/2.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/2.1.kt index 4d71417e66a..93808f80ddc 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/2.1.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/2.1.kt @@ -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" } \ No newline at end of file diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/3.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/3.1.kt index 1b5a849016a..33a9a4453c6 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/3.1.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/try-expression/p-5/pos/3.1.kt @@ -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" } \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt index 6d0b8f12020..f8cb60f5c80 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt @@ -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 /* diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.2.kt b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.2.kt new file mode 100644 index 00000000000..7681d15c8df --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.2.kt @@ -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 if (c) { + "else if true" + } +} + +// TESTCASE NUMBER: 2 + +fun case2() { + var b = true + val c = true + val a = if (b) 1 else if (c) 2 else ; +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.3.kt b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.3.kt new file mode 100644 index 00000000000..49ecbdb4633 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.3.kt @@ -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 = if (throwExc(false)) true +} + + +// TESTCASE NUMBER: 3 +fun case3() { + val x1 = 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 = 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()) +} + +/* + * 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()) +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.4.kt b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.4.kt new file mode 100644 index 00000000000..189b65847c6 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.4.kt @@ -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 = 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 +} + +// TESTCASE NUMBER: 4 + +fun case4(nothing: Nothing) { + val x = if (false) else if (nothing) { "foo"} else +} + +// TESTCASE NUMBER: 5 + +fun case5(nothing: Nothing) { + val x = if (false) else if (nothing) { "foo"} else ; +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/1.2.kt b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/1.2.kt new file mode 100644 index 00000000000..a7ee17453c1 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/1.2.kt @@ -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; +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json index f7f1a1e30e5..efe6f9b6165 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json @@ -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, diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.kt new file mode 100644 index 00000000000..8195fe385e2 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.kt @@ -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 (a) { "true" } else "false" + checkSubtype(a) +} + +/* + * TESTCASE NUMBER: 2 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35517 + */ +fun case2() { + val a = JavaContainer.aO + if (a) { "true" } else "false" + checkSubtype(a) +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos/1.1.kt new file mode 100644 index 00000000000..f637aa9877d --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos/1.1.kt @@ -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(a) + checkSubtype(false) +} + +// TESTCASE NUMBER: 2 +fun case2() { + val a = JavaContainer.aB + if (a) { "true" } else "false" + checkSubtype(a) +} + +// TESTCASE NUMBER: 3 +fun case3() { + val a = JavaContainer.aO as Boolean + if (a) { "true" } else "false" + checkSubtype(a) +} + +// TESTCASE NUMBER: 4 +fun case4(a: Nothing) { + checkSubtype(a) + if (a) { "true" } else "false" + +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/testsMap.json new file mode 100644 index 00000000000..9f25f219548 --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/testsMap.json @@ -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 + } + ] + } + } +} \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/testsMap.json index 1b3e110ecfe..311c66fb73a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/testsMap.json @@ -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 + } + ] + } } } \ No newline at end of file diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java index 26f5edfdac3..88234eef058 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/DiagnosticsTestSpecGenerated.java @@ -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) diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java index ea544fdf2f5..63bc29b6cb0 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java @@ -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)