[Spec tests] Actualize spec tests

This commit is contained in:
victor.petukhov
2019-10-24 16:57:09 +03:00
committed by Victor Petukhov
parent 2dbce2cc41
commit f62901d7d9
106 changed files with 776 additions and 458 deletions
-2
View File
@@ -28,8 +28,6 @@ val generateFeatureInteractionSpecTestData by generator("org.jetbrains.kotlin.sp
val printSpecTestsStatistic by generator("org.jetbrains.kotlin.spec.utils.tasks.PrintSpecTestsStatisticKt")
val generateJsonTestsMap by generator("org.jetbrains.kotlin.spec.utils.tasks.GenerateJsonTestsMapKt")
val remoteRunTests by task<Test> {
val packagePrefix = "org.jetbrains.kotlin.spec."
val includeTests = setOf(
@@ -10,6 +10,6 @@ Exception Details:
locals: { uninitializedThis }
stack: { uninitializedThis, uninitializedThis }
Bytecode:
0x0000000: 2a2a c000 02b6 000a b700 0db1
0000000: 2a2a c000 02b6 000a b700 0db1
Foo.<clinit>(13.kt)
@@ -10,6 +10,6 @@ Exception Details:
locals: { uninitializedThis }
stack: { uninitializedThis, uninitializedThis }
Bytecode:
0x0000000: 2a2a c000 02b6 000a b700 0db1
0000000: 2a2a c000 02b6 000a b700 0db1
Foo.<clinit>(16.kt)
@@ -10,6 +10,6 @@ Exception Details:
locals: { uninitializedThis }
stack: { uninitializedThis, uninitializedThis }
Bytecode:
0x0000000: 2a2a c000 02b6 000a b700 0db1
0000000: 2a2a c000 02b6 000a b700 0db1
Foo.<clinit>(17.kt)
@@ -10,6 +10,6 @@ Exception Details:
locals: { uninitializedThis }
stack: { uninitializedThis, uninitializedThis }
Bytecode:
0x0000000: 2a2a b700 09b1
0000000: 2a2a b700 09b1
Foo.<clinit>(9.kt)
@@ -3,7 +3,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Annotated when statement",
"path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt",
@@ -3,49 +3,49 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
@@ -54,49 +54,49 @@
],
"3": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
@@ -107,21 +107,21 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
@@ -130,21 +130,21 @@
],
"3": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
@@ -157,35 +157,35 @@
"neg": {
"2": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
@@ -194,7 +194,7 @@
],
"3": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
@@ -3,7 +3,7 @@
"neg": {
"4": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
@@ -3,7 +3,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
@@ -14,7 +14,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
@@ -23,7 +23,7 @@
],
"2": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
@@ -36,7 +36,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
@@ -3,14 +3,14 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else returned coercion to unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
@@ -21,28 +21,28 @@
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Else on nullable enum",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Else on nullable enum with smart cast",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
@@ -63,35 +63,35 @@
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When type disjunctions",
"path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Reserved exhaustive when",
"path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
@@ -106,49 +106,49 @@
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
@@ -163,21 +163,21 @@
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
@@ -186,28 +186,28 @@
],
"4": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
@@ -216,91 +216,91 @@
],
"9": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive enum mixed",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive enum is",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive break continue",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Else on nullable enum",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Else on nullable enum with smart cast",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
@@ -309,21 +309,21 @@
],
"5": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
@@ -332,14 +332,14 @@
],
"7": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
@@ -348,7 +348,7 @@
],
"8": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
@@ -377,21 +377,21 @@
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive platform enum null",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
@@ -418,49 +418,49 @@
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive platform enum else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt4434",
"path": "compiler/testData/diagnostics/tests/when/kt4434.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
@@ -475,21 +475,21 @@
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
@@ -514,91 +514,91 @@
],
"9": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive platform enum else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check before",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive platform enum statement",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive platform enum annotated",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive return throw",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive return",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive platform enum null",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
@@ -607,14 +607,14 @@
],
"4": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
@@ -623,14 +623,14 @@
],
"5": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
@@ -643,21 +643,21 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt4434",
"path": "compiler/testData/diagnostics/tests/when/kt4434.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
@@ -668,91 +668,91 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else returned unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else expected unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else returned coercion to unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else no expected type",
"path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else returned non unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt",
@@ -765,7 +765,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
@@ -1,33 +1,35 @@
// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 11
* NUMBER: 1
* DESCRIPTION: 'When' without bound value and with 'else' branch not in the last position.
* DESCRIPTION: 'When' with bound value and non-expressions in 'when condition'.
*/
// 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 ""<!>
fun case_1(value_1: Int, value_2: List<Int>): String {
when (value_1) {
<!EXPRESSION_EXPECTED!>while (false) {}<!> -> return ""
<!EXPRESSION_EXPECTED!>do {} while (false)<!> -> return ""
<!EXPRESSION_EXPECTED!>for (value in value_2) {}<!> -> return ""
}
<!UNREACHABLE_CODE!>return ""<!>
return ""
}
// TESTCASE NUMBER: 4
fun case_4(value_1: Int): String {
var value_2: Int
var value_3 = 10
when (value_1) {
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_2 = 10<!> -> return ""
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_3 %= 10<!> -> return ""
}
return ""
}
@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 9
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 11
* NUMBER: 2
* DESCRIPTION: 'When' with bound value and not allowed break and continue expression (without labels) in 'when condition'.
*/
@@ -0,0 +1,33 @@
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 12
* 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 ""<!>
}
@@ -4,8 +4,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 6
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 7
* NUMBER: 1
* DESCRIPTION: 'When' with bound value and with else branch not in the last position.
*/
@@ -1,35 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 9
* NUMBER: 1
* DESCRIPTION: 'When' with bound value and non-expressions in 'when condition'.
*/
// TESTCASE NUMBER: 1
fun case_1(value_1: Int, value_2: List<Int>): String {
when (value_1) {
<!EXPRESSION_EXPECTED!>while (false) {}<!> -> return ""
<!EXPRESSION_EXPECTED!>do {} while (false)<!> -> return ""
<!EXPRESSION_EXPECTED!>for (value in value_2) {}<!> -> return ""
}
return ""
}
// TESTCASE NUMBER: 4
fun case_4(value_1: Int): String {
var value_2: Int
var value_3 = 10
when (value_1) {
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_2 = 10<!> -> return ""
<!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>value_3 %= 10<!> -> return ""
}
return ""
}
@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 9
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 10
* NUMBER: 1
* DESCRIPTION: 'When' with enumeration of the different variants of expressions in 'when condition'.
* HELPERS: typesProvider, classes, functions
@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 9
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 10
* NUMBER: 2
* DESCRIPTION: 'When' with different variants of the arithmetic expressions (additive expression and multiplicative expression) in 'when condition'.
* HELPERS: typesProvider, classes, functions
@@ -3,8 +3,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 11
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 12
* NUMBER: 1
* DESCRIPTION: 'When' without bound value and with else branch in the last position.
*/
@@ -1,8 +1,8 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 6
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 7
* NUMBER: 1
* DESCRIPTION: 'When' with bound value and else branch.
*/
@@ -0,0 +1,5 @@
package
public fun case_1(/*0*/ value_1: kotlin.Int?): kotlin.String
public fun case_2(/*0*/ value_1: kotlin.Any): kotlin.String
public fun case_3(/*0*/ value_1: kotlin.Int): kotlin.String
@@ -1,6 +1,42 @@
{
"6": {
"neg": {
"12": [
{
"specVersion": "0.1-201",
"casesNumber": 3,
"description": "\u0027When\u0027 without bound value and with \u0027else\u0027 branch not in the last position.",
"unexpectedBehaviour": false
}
],
"11": [
{
"specVersion": "0.1-201",
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in \u0027when condition\u0027.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-201",
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and non-expressions in \u0027when condition\u0027.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
}
],
"1": [
{
"specVersion": "0.1-100",
@@ -85,57 +121,14 @@
"unexpectedBehaviour": false
}
],
"9": [
"7": [
{
"specVersion": "0.1-100",
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and non-expressions in \u0027when condition\u0027.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-100",
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in \u0027when condition\u0027.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false
}
],
"6": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-201",
"casesNumber": 3,
"description": "\u0027When\u0027 with bound value and with else branch not in the last position.",
"unexpectedBehaviour": false
}
],
"11": [
{
"specVersion": "0.1-100",
"casesNumber": 3,
"description": "\u0027When\u0027 without bound value and with \u0027else\u0027 branch not in the last position.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
}
],
"5": [
{
"specVersion": "0.1-155",
@@ -166,6 +159,15 @@
"unexpectedBehaviour": false
}
],
"9": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false
}
],
"10": [
{
"specVersion": "0.1-155",
@@ -184,6 +186,14 @@
]
},
"pos": {
"12": [
{
"specVersion": "0.1-201",
"casesNumber": 2,
"description": "\u0027When\u0027 without bound value and with else branch in the last position.",
"unexpectedBehaviour": false
}
],
"1": [
{
"specVersion": "0.1-100",
@@ -231,6 +241,20 @@
"unexpectedBehaviour": false
}
],
"10": [
{
"specVersion": "0.1-201",
"casesNumber": 26,
"description": "\u0027When\u0027 with different variants of the arithmetic expressions (additive expression and multiplicative expression) in \u0027when condition\u0027.",
"unexpectedBehaviour": true
},
{
"specVersion": "0.1-201",
"casesNumber": 23,
"description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.",
"unexpectedBehaviour": false
}
],
"3": [
{
"specVersion": "0.1-100",
@@ -245,36 +269,14 @@
"unexpectedBehaviour": false
}
],
"9": [
"7": [
{
"specVersion": "0.1-100",
"casesNumber": 23,
"description": "\u0027When\u0027 with enumeration of the different variants of expressions in \u0027when condition\u0027.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-100",
"casesNumber": 26,
"description": "\u0027When\u0027 with different variants of the arithmetic expressions (additive expression and multiplicative expression) in \u0027when condition\u0027.",
"unexpectedBehaviour": true
}
],
"6": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-201",
"casesNumber": 3,
"description": "\u0027When\u0027 with bound value and else branch.",
"unexpectedBehaviour": false
}
],
"11": [
{
"specVersion": "0.1-100",
"casesNumber": 2,
"description": "\u0027When\u0027 without bound value and with else branch in the last position.",
"unexpectedBehaviour": false
}
],
"5": [
{
"specVersion": "0.1-155",
@@ -3,14 +3,14 @@
"neg": {
"3": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
@@ -21,7 +21,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
@@ -34,7 +34,7 @@
"neg": {
"3": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
@@ -3,7 +3,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
@@ -3,7 +3,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
@@ -14,14 +14,14 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
@@ -34,14 +34,14 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
@@ -3,49 +3,49 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check before",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
@@ -54,14 +54,14 @@
],
"8": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
@@ -72,35 +72,35 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When type disjunctions",
"path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
@@ -109,7 +109,7 @@
],
"6": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
@@ -118,7 +118,7 @@
],
"8": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
@@ -5,7 +5,7 @@
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-100
* SPEC VERSION: 0.1-201
* PLACE: type-system, introduction-1 -> paragraph 8 -> sentence 1
* RELEVANT PLACES: type-system, type-kinds, built-in-types, kotlin.Any -> paragraph 1 -> sentence 1
* NUMBER: 1
@@ -55,7 +55,7 @@
],
"1": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-201",
"casesNumber": 13,
"description": "The use of Boolean literals as the identifier (with backtick) in the class.",
"unexpectedBehaviour": false
@@ -67,7 +67,7 @@
"pos": {
"2": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
@@ -3,7 +3,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
@@ -12,7 +12,7 @@
],
"2": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
@@ -3,7 +3,7 @@
"neg": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
@@ -14,7 +14,7 @@
"pos": {
"3": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
@@ -3,7 +3,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-201",
"casesNumber": 13,
"description": "The use of Boolean literals as the identifier (with backtick) in the class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt",
@@ -3,7 +3,7 @@
"pos": {
"1": [
{
"specVersion": "0.1-155",
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
@@ -1,8 +1,8 @@
/*
* KOTLIN PSI SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 11
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 12
* NUMBER: 1
* DESCRIPTION: 'When' with invalid else condition.
*/
@@ -0,0 +1,160 @@
KtFile: 12.1.kt
PACKAGE_DIRECTIVE
<empty list>
IMPORT_LIST
<empty list>
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('case_1')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
WHEN
PsiElement(when)('when')
PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('value')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
WHEN_ENTRY
PsiElement(else)('else')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
WHEN
PsiElement(when)('when')
PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('value')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
WHEN_ENTRY
PsiElement(else)('else')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
WHEN_ENTRY
PsiElement(else)('else')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
WHEN
PsiElement(when)('when')
PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('value')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('println')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
LITERAL_STRING_TEMPLATE_ENTRY
PsiElement(REGULAR_STRING_PART)('1')
PsiElement(CLOSING_QUOTE)('"')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('2')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('println')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
LITERAL_STRING_TEMPLATE_ENTRY
PsiElement(REGULAR_STRING_PART)('2')
PsiElement(CLOSING_QUOTE)('"')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
WHEN_ENTRY
PsiElement(else)('else')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
WHEN
PsiElement(when)('when')
PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('value')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('println')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
LITERAL_STRING_TEMPLATE_ENTRY
PsiElement(REGULAR_STRING_PART)('!')
PsiElement(CLOSING_QUOTE)('"')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
WHEN_ENTRY
PsiElement(else)('else')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
@@ -1,8 +1,8 @@
/*
* KOTLIN PSI SPEC TEST (NEGATIVE)
*
* SPEC VERSION: 0.1-100
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 8
* SPEC VERSION: 0.1-201
* PLACE: expressions, when-expression -> paragraph 6 -> sentence 9
* NUMBER: 1
* DESCRIPTION: 'When' with bound value and not allowed spread operator in 'when condition'.
*/
@@ -0,0 +1,138 @@
KtFile: 9.1.kt
PACKAGE_DIRECTIVE
<empty list>
IMPORT_LIST
<empty list>
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('case_1')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
WHEN
PsiElement(when)('when')
PsiWhiteSpace(' ')
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('value')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
PsiErrorElement:Expecting an expression
<empty list>
PsiErrorElement:Expecting '->'
PsiElement(MUL)('*')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('value')
PsiWhiteSpace(' ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
PsiErrorElement:Expecting an expression, is-condition or in-condition
<empty list>
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
PsiWhiteSpace(' ')
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
PsiElement(CLOSING_QUOTE)('"')
PsiWhiteSpace('\n ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
PsiErrorElement:Expecting an expression
<empty list>
PsiErrorElement:Expecting '->'
PsiElement(MUL)('*')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('arrayOf')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
LITERAL_STRING_TEMPLATE_ENTRY
PsiElement(REGULAR_STRING_PART)('a')
PsiElement(CLOSING_QUOTE)('"')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_ARGUMENT
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
LITERAL_STRING_TEMPLATE_ENTRY
PsiElement(REGULAR_STRING_PART)('b')
PsiElement(CLOSING_QUOTE)('"')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_ARGUMENT
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
LITERAL_STRING_TEMPLATE_ENTRY
PsiElement(REGULAR_STRING_PART)('c')
PsiElement(CLOSING_QUOTE)('"')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
PsiErrorElement:Expecting an expression, is-condition or in-condition
<empty list>
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
PsiWhiteSpace(' ')
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
PsiElement(CLOSING_QUOTE)('"')
PsiWhiteSpace('\n ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
PsiErrorElement:Expecting an expression
<empty list>
PsiErrorElement:Expecting '->'
PsiElement(MUL)('*')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('listOf')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
NULL
PsiElement(null)('null')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_ARGUMENT
NULL
PsiElement(null)('null')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_ARGUMENT
NULL
PsiElement(null)('null')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
WHEN_ENTRY
WHEN_CONDITION_WITH_EXPRESSION
PsiErrorElement:Expecting an expression, is-condition or in-condition
<empty list>
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
PsiWhiteSpace(' ')
STRING_TEMPLATE
PsiElement(OPEN_QUOTE)('"')
PsiElement(CLOSING_QUOTE)('"')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
@@ -1,6 +1,14 @@
{
"6": {
"neg": {
"12": [
{
"specVersion": "0.1-201",
"casesNumber": 0,
"description": "\u0027When\u0027 with invalid else condition.",
"unexpectedBehaviour": false
}
],
"1": [
{
"specVersion": "0.1-100",
@@ -23,21 +31,13 @@
"unexpectedBehaviour": false
}
],
"8": [
"9": [
{
"specVersion": "0.1-100",
"specVersion": "0.1-201",
"casesNumber": 0,
"description": "\u0027When\u0027 with bound value and not allowed spread operator in \u0027when condition\u0027.",
"unexpectedBehaviour": false
}
],
"11": [
{
"specVersion": "0.1-100",
"casesNumber": 0,
"description": "\u0027When\u0027 with invalid else condition.",
"unexpectedBehaviour": false
}
]
}
},
@@ -3185,6 +3185,16 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.1.kt");
}
@TestMetadata("11.2.kt")
public void test11_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/11.2.kt");
}
@TestMetadata("12.1.kt")
public void test12_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/12.1.kt");
}
@TestMetadata("1.1.kt")
public void test1_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/1.1.kt");
@@ -3205,19 +3215,9 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.2.kt");
}
@TestMetadata("6.1.kt")
public void test6_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/6.1.kt");
}
@TestMetadata("9.1.kt")
public void test9_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.1.kt");
}
@TestMetadata("9.2.kt")
public void test9_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/9.2.kt");
@TestMetadata("7.1.kt")
public void test7_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.1.kt");
}
public void testAllFilesPresentInNeg() throws Exception {
@@ -3233,9 +3233,19 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("11.1.kt")
public void test11_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/11.1.kt");
@TestMetadata("10.1.kt")
public void test10_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.1.kt");
}
@TestMetadata("10.2.kt")
public void test10_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/10.2.kt");
}
@TestMetadata("12.1.kt")
public void test12_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/12.1.kt");
}
@TestMetadata("1.1.kt")
@@ -3268,19 +3278,9 @@ public class DiagnosticsTestSpecGenerated extends AbstractDiagnosticsTestSpec {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/3.2.kt");
}
@TestMetadata("6.1.kt")
public void test6_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt");
}
@TestMetadata("9.1.kt")
public void test9_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.1.kt");
}
@TestMetadata("9.2.kt")
public void test9_2() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/9.2.kt");
@TestMetadata("7.1.kt")
public void test7_1() throws Exception {
runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.kt");
}
public void testAllFilesPresentInPos() throws Exception {
@@ -65,7 +65,7 @@ class SpecTestsConsistencyTest : TestCase() {
val paragraphForTestSentences =
specSentencesForCurrentTest[sectionsPath] ?: throw Exception("$sectionsPath not found")
if (paragraphForTestSentences.size < sentenceNumber) {
throw Exception("$sentenceNumber not found")
fail("Sentence #$sentenceNumber not found (${file.path})")
}
val expectedSentence = paragraphForTestSentences[sentenceNumber - 1]
val actualSentence = paragraphSentences[sentenceNumber - 1]
@@ -18,7 +18,7 @@ abstract class AbstractParsingTestSpec : AbstractParsingTest() {
override fun doParsingTest(filePath: String) {
val file = File(filePath)
val (specTest, testLinkedType) = CommonParser.parseSpecTest(
filePath,
file.canonicalPath,
mapOf("main.kt" to FileUtil.loadFile(file, true))
)
@@ -1150,9 +1150,9 @@ public class ParsingTestSpecGenerated extends AbstractParsingTestSpec {
KotlinTestUtils.runTest(this::doParsingTest, this, testDataFilePath);
}
@TestMetadata("11.1.kt")
public void test11_1() throws Exception {
runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/11.1.kt");
@TestMetadata("12.1.kt")
public void test12_1() throws Exception {
runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/12.1.kt");
}
@TestMetadata("1.1.kt")
@@ -1170,9 +1170,9 @@ public class ParsingTestSpecGenerated extends AbstractParsingTestSpec {
runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/3.1.kt");
}
@TestMetadata("8.1.kt")
public void test8_1() throws Exception {
runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/8.1.kt");
@TestMetadata("9.1.kt")
public void test9_1() throws Exception {
runTest("compiler/tests-spec/testData/psi/linked/expressions/when-expression/p-6/neg/9.1.kt");
}
public void testAllFilesPresentInNeg() throws Exception {
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.spec.utils.models.LinkedSpecTest
import org.jetbrains.kotlin.spec.utils.models.LinkedSpecTest.Companion.getInstanceForImplementationTest
import org.jetbrains.kotlin.spec.utils.models.SpecPlace
import org.jetbrains.kotlin.spec.utils.parsers.CommonParser
import org.jetbrains.kotlin.spec.utils.parsers.CommonParser.parseImplementationTest
import org.jetbrains.kotlin.spec.utils.parsers.ImplementationTestPatterns
import java.io.File
@@ -20,8 +21,6 @@ object TestsJsonMapGenerator {
private const val LINKED_TESTS_PATH = "linked"
const val TESTS_MAP_FILENAME = "testsMap.json"
private val testsMap = JsonObject()
private inline fun <reified T : JsonElement> JsonObject.getOrCreate(key: String): T {
if (!has(key)) {
add(key, T::class.java.newInstance())
@@ -50,7 +49,9 @@ object TestsJsonMapGenerator {
)
}
private fun collectInfoFromSpecTests() {
private fun collectInfoFromSpecTests(): JsonObject {
val testsMap = JsonObject()
TestArea.values().forEach { testArea ->
File("${GeneralConfiguration.SPEC_TESTDATA_PATH}/${testArea.testDataPath}/$LINKED_TESTS_PATH").walkTopDown()
.forEach testFiles@{ file ->
@@ -70,50 +71,41 @@ object TestsJsonMapGenerator {
}
}
}
return testsMap
}
private fun collectInfoFromImplementationTests() {
private fun collectInfoFromImplementationTests(): JsonObject {
val testsMap = JsonObject()
TestArea.values().forEach { testArea ->
File("${GeneralConfiguration.TESTDATA_PATH}/${testArea.testDataPath}").walkTopDown()
.forEach testFiles@{ file ->
if (!file.isFile || file.extension != "kt") return@testFiles
val files = File("${GeneralConfiguration.TESTDATA_PATH}/${testArea.testDataPath}").walkTopDown()
val matcher = ImplementationTestPatterns.testInfoPattern.matcher(file.readText())
for (file in files) {
if (!file.isFile || file.extension != "kt") continue
if (!matcher.find()) return@testFiles
val parserImplementationTest = parseImplementationTest(file, testArea)
val relevantPlaces = parserImplementationTest.relevantPlaces ?: listOf()
val specVersion = matcher.group("specVersion")
val testType = TestType.fromValue(matcher.group("testType"))!!
val testSpecSentenceList = matcher.group("testSpecSentenceList")
val specSentenceListMatcher = ImplementationTestPatterns.relevantSpecSentencesPattern.matcher(testSpecSentenceList)
val specPlaces = mutableSetOf<SpecPlace>()
while (specSentenceListMatcher.find()) {
specPlaces.add(
SpecPlace(
sections = specSentenceListMatcher.group("specSections").split(Regex(""",\s*""")),
paragraphNumber = specSentenceListMatcher.group("specParagraph").toInt(),
sentenceNumber = specSentenceListMatcher.group("specSentence").toInt()
)
)
}
specPlaces.forEach { specPlace ->
testsMap.getOrCreateSpecTestObject(specPlace, testArea, testType).add(
getTestInfo(
getInstanceForImplementationTest(specVersion, testArea, testType, specPlace, file.nameWithoutExtension),
file
)
)
}
(relevantPlaces + parserImplementationTest.place).forEach { specPlace ->
testsMap.getOrCreateSpecTestObject(specPlace, testArea, parserImplementationTest.testType).add(
getTestInfo(parseImplementationTest(file, testArea), file)
)
}
}
}
return testsMap
}
operator fun JsonObject.plus(other: JsonObject) =
JsonObject().also { new ->
this.keySet().forEach { new.add(it, this.get(it)) }
other.keySet().forEach { new.add(it, other.get(it)) }
}
fun buildTestsMapPerSection() {
collectInfoFromSpecTests()
collectInfoFromImplementationTests()
val testsMap = collectInfoFromSpecTests() + collectInfoFromImplementationTests()
val gson = GsonBuilder().setPrettyPrinting().create()
testsMap.keySet().forEach { testPath ->
@@ -55,15 +55,15 @@ class LinkedSpecTest(
specVersion: String,
testArea: TestArea,
testType: TestType,
specPlace: SpecPlace,
specPlaces: List<SpecPlace>,
filename: String
): LinkedSpecTest {
val description = filename[0].toUpperCase() +
filename.substring(1).replace(Regex("""([A-Z])"""), " $1").toLowerCase()
return LinkedSpecTest(
specVersion, testArea, testType, specPlace,
null, 0, description,
specVersion, testArea, testType, specPlaces.first(),
specPlaces.subList(1, specPlaces.size - 1), 0, description,
SpecTestCasesSet(mutableMapOf(), mutableMapOf(), mutableMapOf()),
unexpectedBehavior = false, unspecifiedBehavior = false, issues = setOf(), helpers = null, exception = null
)
@@ -5,10 +5,7 @@
package org.jetbrains.kotlin.spec.utils.parsers
import org.jetbrains.kotlin.spec.utils.SpecTestInfoElementContent
import org.jetbrains.kotlin.spec.utils.SpecTestInfoElementType
import org.jetbrains.kotlin.spec.utils.SpecTestLinkedType
import org.jetbrains.kotlin.spec.utils.TestFiles
import org.jetbrains.kotlin.spec.utils.*
import org.jetbrains.kotlin.spec.utils.models.*
import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.testInfoElementPattern
import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.testPathBaseRegexTemplate
@@ -47,6 +44,32 @@ object CommonParser {
throw SpecTestValidationException(SpecTestValidationFailedReason.FILENAME_NOT_VALID)
}
fun parseImplementationTest(file: File, testArea: TestArea): LinkedSpecTest {
val matcher = ImplementationTestPatterns.testInfoPattern.matcher(file.readText())
if (!matcher.find())
throw SpecTestValidationException(SpecTestValidationFailedReason.TESTINFO_NOT_VALID)
val testType = TestType.fromValue(matcher.group("testType"))
?: throw SpecTestValidationException(SpecTestValidationFailedReason.TESTINFO_NOT_VALID)
val specVersion = matcher.group("specVersion")
val testSpecSentenceList = matcher.group("testSpecSentenceList")
val specSentenceListMatcher = ImplementationTestPatterns.relevantSpecSentencesPattern.matcher(testSpecSentenceList)
val specPlaces = mutableListOf<SpecPlace>()
while (specSentenceListMatcher.find()) {
specPlaces.add(
SpecPlace(
sections = specSentenceListMatcher.group("specSections").split(Regex(""",\s*""")),
paragraphNumber = specSentenceListMatcher.group("specParagraph").toInt(),
sentenceNumber = specSentenceListMatcher.group("specSentence").toInt()
)
)
}
return LinkedSpecTest.getInstanceForImplementationTest(specVersion, testArea, testType, specPlaces, file.nameWithoutExtension)
}
private fun createSpecPlace(placeMatcher: Matcher, basePlaceMatcher: Matcher = placeMatcher) =
SpecPlace(
placeMatcher.group("sections")?.splitByComma() ?: basePlaceMatcher.group("sections").splitByComma(),