[Spec tests] Link diagnostic tests for when expression with Kotlin specification

This commit is contained in:
victor.petukhov
2019-09-04 18:42:50 +03:00
committed by Victor Petukhov
parent c338fdd677
commit 2dbce2cc41
88 changed files with 2760 additions and 32 deletions
@@ -0,0 +1,15 @@
{
"1": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Annotated when statement",
"path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,206 @@
{
"2": {
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
}
],
"3": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
}
]
},
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
"unexpectedBehaviour": false
}
],
"3": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
"unexpectedBehaviour": false
}
]
}
},
"3": {
"neg": {
"2": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
}
],
"3": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,15 @@
{
"6": {
"neg": {
"4": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,48 @@
{
"7": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
]
},
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
"unexpectedBehaviour": false
}
],
"2": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
"unexpectedBehaviour": false
}
]
}
},
"8": {
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,22 @@
{
"10": {
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned coercion to unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -19,6 +19,34 @@
"casesNumber": 3,
"description": "Non-exhaustive when using nullable boolean values.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Else on nullable enum",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Else on nullable enum with smart cast",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
"unexpectedBehaviour": false
}
],
"1": [
@@ -33,6 +61,41 @@
"casesNumber": 3,
"description": "Non-exhaustive when, without bound value, without else branch.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When type disjunctions",
"path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Reserved exhaustive when",
"path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
"unexpectedBehaviour": false
}
],
"3": [
@@ -41,6 +104,55 @@
"casesNumber": 5,
"description": "Non-exhaustive when using boolean values.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
}
],
"6": [
@@ -49,6 +161,198 @@
"casesNumber": 12,
"description": "Non-exhaustive when using subclasses of the sealed class.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
"unexpectedBehaviour": false
}
],
"4": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
"unexpectedBehaviour": false
}
],
"9": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive enum mixed",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive enum is",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive break continue",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Else on nullable enum",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Else on nullable enum with smart cast",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
"unexpectedBehaviour": false
}
],
"5": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
"unexpectedBehaviour": false
}
],
"7": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
"unexpectedBehaviour": false
}
],
"8": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
"unexpectedBehaviour": false
}
]
},
@@ -71,6 +375,27 @@
"casesNumber": 2,
"description": "Exhaustive when using nullable boolean values.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum null",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
"unexpectedBehaviour": false
}
],
"1": [
@@ -91,6 +416,55 @@
"casesNumber": 3,
"description": "Exhaustive when, without bound value, with else branch.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt4434",
"path": "compiler/testData/diagnostics/tests/when/kt4434.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
],
"3": [
@@ -99,6 +473,27 @@
"casesNumber": 2,
"description": "Exhaustive when using boolean values.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
"unexpectedBehaviour": false
}
],
"8": [
@@ -116,6 +511,266 @@
"description": "Exhaustive when using subclasses of the sealed class.",
"unexpectedBehaviour": true
}
],
"9": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check before",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum statement",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum annotated",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive return throw",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive return",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum null",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
"unexpectedBehaviour": false
}
],
"4": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
"unexpectedBehaviour": false
}
],
"5": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
"unexpectedBehaviour": false
}
]
}
},
"1": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt4434",
"path": "compiler/testData/diagnostics/tests/when/kt4434.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
}
]
},
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else expected unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned coercion to unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else no expected type",
"path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned non unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt",
"unexpectedBehaviour": false
}
]
}
},
"3": {
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
}
]
}
}
@@ -13,6 +13,55 @@
"casesNumber": 3,
"description": "\u0027When\u0027 with bound value and type test condition (without companion object in classes), but without type checking operator.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When type disjunctions",
"path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
"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": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive enum mixed",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive enum is",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
"unexpectedBehaviour": false
}
],
"3": [
@@ -27,6 +76,13 @@
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and \u0027when condition\u0027 with contains operator and type without defined contains operator.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false
}
],
"9": [
@@ -41,6 +97,13 @@
"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": [
@@ -57,6 +120,66 @@
"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",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression enum",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive enum mixed",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt",
"unexpectedBehaviour": false
}
],
"10": [
{
"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
}
]
},
@@ -85,6 +208,27 @@
"casesNumber": 6,
"description": "\u0027When\u0027 with bound value and type test condition.",
"unexpectedBehaviour": true
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
],
"3": [
@@ -130,6 +274,29 @@
"description": "\u0027When\u0027 without bound value and with else branch in the last position.",
"unexpectedBehaviour": false
}
],
"5": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Annotated when statement",
"path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt4434",
"path": "compiler/testData/diagnostics/tests/when/kt4434.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
}
]
}
},
@@ -149,6 +316,40 @@
"unexpectedBehaviour": false
}
]
},
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression enum",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt",
"unexpectedBehaviour": false
}
],
"2": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression enum",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt",
"unexpectedBehaviour": false
}
]
}
},
"4": {
@@ -207,6 +408,36 @@
"casesNumber": 2,
"description": "Forbidden break and continue in the control structure body of when.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Reserved exhaustive when",
"path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
"unexpectedBehaviour": false
}
],
"5": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When",
"path": "compiler/testData/diagnostics/tests/when/When.kt",
"unexpectedBehaviour": false
}
]
},
@@ -237,6 +468,52 @@
"casesNumber": 25,
"description": "When without bound value, various expressions in the control structure body.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Comma in when condition without argument",
"path": "compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
],
"4": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Duplicated labels",
"path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt",
"unexpectedBehaviour": false
}
],
"5": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Duplicated labels",
"path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt",
"unexpectedBehaviour": false
}
]
}
@@ -249,6 +526,244 @@
"casesNumber": 2,
"description": "\u0027When\u0027 with bound value and not allowed break and continue expression (without labels) in the control structure body.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When type disjunctions",
"path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else expected unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive val over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean brackets",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt",
"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": "Exhaustive boolean complex",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned coercion to unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning false",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningFalse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Reserved exhaustive when",
"path": "compiler/testData/diagnostics/tests/when/ReservedExhaustiveWhen.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive var over conditional init",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression enum",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive enum mixed",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Empty condition with expression",
"path": "compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Property not initialized",
"path": "compiler/testData/diagnostics/tests/when/PropertyNotInitialized.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning else",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Redundant else",
"path": "compiler/testData/diagnostics/tests/when/RedundantElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else no expected type",
"path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive enum is",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned non unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive break continue",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Top level sealed",
"path": "compiler/testData/diagnostics/tests/when/TopLevelSealed.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Else on nullable enum",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Else on nullable enum with smart cast",
"path": "compiler/testData/diagnostics/tests/when/ElseOnNullableEnumWithSmartCast.kt",
"unexpectedBehaviour": false
}
]
},
@@ -259,6 +774,312 @@
"casesNumber": 25,
"description": "\u0027When\u0027 with bound value and with different variants of expressions in the control structure body.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Annotated when statement",
"path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check before",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt4434",
"path": "compiler/testData/diagnostics/tests/when/kt4434.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Duplicated labels",
"path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum statement",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumStatement.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnum.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Comma in when condition without argument",
"path": "compiler/testData/diagnostics/tests/when/CommaInWhenConditionWithoutArgument.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive nullable",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum annotated",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else when statement",
"path": "compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive boolean nullable",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveBooleanNullable.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive no initialization",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveNoInitialization.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive return throw",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive return",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive platform enum null",
"path": "compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt",
"unexpectedBehaviour": false
}
]
}
},
"9": {
"pos": {
"2": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Annotated when statement",
"path": "compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else when statement",
"path": "compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt",
"unexpectedBehaviour": false
}
],
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Duplicated labels",
"path": "compiler/testData/diagnostics/tests/when/DuplicatedLabels.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
}
]
},
"neg": {
"2": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning null",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else expected unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarning.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned coercion to unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedCoercionToUnit.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else no expected type",
"path": "compiler/testData/diagnostics/tests/when/NoElseNoExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned non unit",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedNonUnit.kt",
"unexpectedBehaviour": false
}
]
}
@@ -0,0 +1,46 @@
{
"3": {
"neg": {
"3": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "No else returned from lambda expected int",
"path": "compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.kt",
"unexpectedBehaviour": false
}
]
},
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
}
]
}
},
"1": {
"neg": {
"3": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When with nothing and lambdas",
"path": "compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,15 @@
{
"1": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,53 @@
{
"2": {
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
"unexpectedBehaviour": false
}
]
},
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
]
}
},
"8": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,130 @@
{
"9": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check before",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Exhaustive with nullability check boolean",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBoolean.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
],
"8": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch false bypass else",
"path": "compiler/testData/diagnostics/tests/when/BranchFalseBypassElse.kt",
"unexpectedBehaviour": false
}
]
},
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When type disjunctions",
"path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive warning for sealed class",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Non exhaustive with nullability check",
"path": "compiler/testData/diagnostics/tests/when/NonExhaustiveWithNullabilityCheck.kt",
"unexpectedBehaviour": false
}
],
"6": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass val",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVal.kt",
"unexpectedBehaviour": false
}
],
"8": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Branch bypass var",
"path": "compiler/testData/diagnostics/tests/when/BranchBypassVar.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -62,5 +62,18 @@
}
]
}
},
"5": {
"pos": {
"2": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,24 @@
{
"4": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
}
],
"2": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,26 @@
{
"2": {
"neg": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "When and lambda with expected type",
"path": "compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt",
"unexpectedBehaviour": false
}
]
},
"pos": {
"3": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -0,0 +1,15 @@
{
"4": {
"pos": {
"1": [
{
"specVersion": "0.1-155",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.spec.codegen
import com.intellij.openapi.util.io.FileUtil
import org.jetbrains.kotlin.TestExceptionsComparator
import org.jetbrains.kotlin.codegen.AbstractBlackBoxCodegenTest
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.models.AbstractSpecTest
import org.jetbrains.kotlin.spec.utils.parsers.CommonParser
import org.jetbrains.kotlin.spec.utils.parsers.CommonPatterns.packagePattern
@@ -19,7 +19,7 @@ import java.io.*
abstract class AbstractBlackBoxCodegenTestSpec : AbstractBlackBoxCodegenTest() {
companion object {
private const val CODEGEN_BOX_TESTDATA_PATH = "$TESTDATA_PATH/codegen/box"
private const val CODEGEN_BOX_TESTDATA_PATH = "$SPEC_TESTDATA_PATH/codegen/box"
private const val HELPERS_PATH = "$CODEGEN_BOX_TESTDATA_PATH/helpers"
private const val HELPERS_PACKAGE_VARIABLE = "<!PACKAGE!>"
}
@@ -37,11 +37,11 @@ class SpecTestsConsistencyTest : TestCase() {
TestArea.values().forEach { testArea ->
val testDataPath =
"${GeneralConfiguration.TESTDATA_PATH}/${testArea.testDataPath}/${SpecTestLinkedType.LINKED.testDataPath}"
"${GeneralConfiguration.SPEC_TESTDATA_PATH}/${testArea.testDataPath}/${SpecTestLinkedType.LINKED.testDataPath}"
testFiles += File(testDataPath).let { testsDir ->
testsDir.walkTopDown().filter { it.extension == "kt" }.map {
arrayOf(it.relativeTo(File(GeneralConfiguration.TESTDATA_PATH)).path.replace("/", "$"))
arrayOf(it.relativeTo(File(GeneralConfiguration.SPEC_TESTDATA_PATH)).path.replace("/", "$"))
}.toList()
}
}
@@ -52,7 +52,7 @@ class SpecTestsConsistencyTest : TestCase() {
@Test
fun doTest() {
val file = File("${GeneralConfiguration.TESTDATA_PATH}/${testFilePath.replace("$", "/")}")
val file = File("${GeneralConfiguration.SPEC_TESTDATA_PATH}/${testFilePath.replace("$", "/")}")
val specSentences = specSentencesStorage.getLatest() ?: return
val test = parseLinkedSpecTest(file.canonicalPath, mapOf("main" to file.readText()))
val sectionsPath = setOf(*test.place.sections.toTypedArray(), test.place.paragraphNumber).joinToString()
@@ -6,7 +6,8 @@
package org.jetbrains.kotlin.spec.utils
object GeneralConfiguration {
const val MODULE_PATH = "compiler/tests-spec"
const val TESTDATA_PATH = "$MODULE_PATH/testData"
const val TEST_PATH = "$MODULE_PATH/tests"
const val TESTDATA_PATH = "compiler/testData"
const val SPEC_MODULE_PATH = "compiler/tests-spec"
const val SPEC_TESTDATA_PATH = "$SPEC_MODULE_PATH/testData"
const val SPEC_TEST_PATH = "$SPEC_MODULE_PATH/tests"
}
@@ -10,13 +10,17 @@ import com.google.gson.JsonArray
import com.google.gson.JsonElement
import com.google.gson.JsonObject
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.ImplementationTestPatterns
import java.io.File
object TestsJsonMapGenerator {
private const val LINKED_TESTS_PATH = "linked"
private const val TESTS_MAP_FILENAME = "testsMap.json"
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)) {
@@ -46,11 +50,9 @@ object TestsJsonMapGenerator {
)
}
fun buildTestsMapPerSection() {
val testsMap = JsonObject()
private fun collectInfoFromSpecTests() {
TestArea.values().forEach { testArea ->
File("${GeneralConfiguration.TESTDATA_PATH}/${testArea.testDataPath}/$LINKED_TESTS_PATH").walkTopDown()
File("${GeneralConfiguration.SPEC_TESTDATA_PATH}/${testArea.testDataPath}/$LINKED_TESTS_PATH").walkTopDown()
.forEach testFiles@{ file ->
if (!file.isFile || file.extension != "kt") return@testFiles
@@ -68,11 +70,57 @@ object TestsJsonMapGenerator {
}
}
}
}
private fun collectInfoFromImplementationTests() {
TestArea.values().forEach { testArea ->
File("${GeneralConfiguration.TESTDATA_PATH}/${testArea.testDataPath}").walkTopDown()
.forEach testFiles@{ file ->
if (!file.isFile || file.extension != "kt") return@testFiles
val matcher = ImplementationTestPatterns.testInfoPattern.matcher(file.readText())
if (!matcher.find()) return@testFiles
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
)
)
}
}
}
}
fun buildTestsMapPerSection() {
collectInfoFromSpecTests()
collectInfoFromImplementationTests()
val gson = GsonBuilder().setPrettyPrinting().create()
testsMap.keySet().forEach { testPath ->
File("${GeneralConfiguration.TESTDATA_PATH}/$testPath/$TESTS_MAP_FILENAME").writeText(gson.toJson(testsMap.get(testPath)))
val testMapFolder = "${GeneralConfiguration.SPEC_TESTDATA_PATH}/$testPath"
File(testMapFolder).mkdirs()
File("$testMapFolder/$TESTS_MAP_FILENAME").writeText(gson.toJson(testsMap.get(testPath)))
}
}
}
@@ -5,7 +5,7 @@
package org.jetbrains.kotlin.spec.utils
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.models.AbstractSpecTest
import org.jetbrains.kotlin.spec.utils.parsers.CommonParser
import java.io.File
@@ -43,7 +43,7 @@ object TestsStatisticCollector {
val statistic = mutableMapOf<TestArea, SpecTestsStatElement>()
for (specTestArea in TestArea.values()) {
val specTestsPath = "$TESTDATA_PATH/${specTestArea.name.toLowerCase().replace("_", "/")}/${testLinkedType.testDataPath}"
val specTestsPath = "$SPEC_TESTDATA_PATH/${specTestArea.name.toLowerCase().replace("_", "/")}/${testLinkedType.testDataPath}"
statistic[specTestArea] =
SpecTestsStatElement(SpecTestsStatElementType.AREA)
@@ -5,7 +5,7 @@
package org.jetbrains.kotlin.spec.utils.generators.templates
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TESTDATA_PATH
import java.io.File
import java.util.regex.Pattern
@@ -78,8 +78,8 @@ class FeatureInteractionTestDataGenerator(private val configuration: GenerationS
fun generate() {
var testNumber = 1
val testsPartPath = "$TESTDATA_PATH/${configuration.getTestsPartPath()}"
val layoutTemplate = File("$TESTDATA_PATH/${configuration.getLayoutPath()}").readText()
val testsPartPath = "$SPEC_TESTDATA_PATH/${configuration.getTestsPartPath()}"
val layoutTemplate = File("$SPEC_TESTDATA_PATH/${configuration.getLayoutPath()}").readText()
File(testsPartPath).parentFile.mkdirs()
@@ -5,7 +5,7 @@
package org.jetbrains.kotlin.spec.utils.generators.templates
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.TestArea
import java.io.File
@@ -24,7 +24,7 @@ class FeatureTemplatesConfig(
var currentTemplatesIterator = getTemplatesIterator()
private fun getTemplatesPath(testArea: TestArea) = buildString {
append(TESTDATA_PATH)
append(SPEC_TESTDATA_PATH)
append("/${testArea.testDataPath}")
append("/${FeatureInteractionTestDataGenerator.TEMPLATES_PATH}")
append("/$templatesPath")
@@ -50,6 +50,26 @@ class LinkedSpecTest(
helpers: Set<String>?,
exception: TestsExceptionType?
) : AbstractSpecTest(testArea, testType, place.sections, testNumber, description, cases, unexpectedBehavior, issues, helpers, exception) {
companion object {
fun getInstanceForImplementationTest(
specVersion: String,
testArea: TestArea,
testType: TestType,
specPlace: 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,
SpecTestCasesSet(mutableMapOf(), mutableMapOf(), mutableMapOf()),
unexpectedBehavior = false, unspecifiedBehavior = false, issues = setOf(), helpers = null, exception = null
)
}
}
override fun checkPathConsistency(pathMatcher: Matcher) =
testArea == TestArea.valueOf(pathMatcher.group("testArea").withUnderscores())
&& testType == TestType.fromValue(pathMatcher.group("testType"))!!
@@ -65,7 +65,7 @@ object NotLinkedSpecTestPatterns : BasePatterns {
}
object LinkedSpecTestPatterns : BasePatterns {
const val FILENAME_REGEX = """(?<sentenceNumber>$INTEGER_REGEX)\.(?<testNumber>$INTEGER_REGEX)\.kt"""
private const val FILENAME_REGEX = """(?<sentenceNumber>$INTEGER_REGEX)\.(?<testNumber>$INTEGER_REGEX)\.kt"""
override val pathPartRegex =
"""${SpecTestLinkedType.LINKED.testDataPath}$ps$sectionsInPathRegex${ps}p-(?<paragraphNumber>$INTEGER_REGEX)"""
@@ -98,3 +98,10 @@ object TestCasePatterns {
val testCaseInfoPattern: Pattern = Pattern.compile("(?:$testCaseInfoSingleLineRegex)|(?:$testCaseInfoMultilineRegex)")
val testCaseNumberPattern: Pattern = Pattern.compile("""([1-9]\d*)(,\s*[1-9]\d*)*""")
}
object ImplementationTestPatterns {
val testInfoPattern: Pattern =
Pattern.compile(MULTILINE_COMMENT_REGEX.format("""\*\s+RELEVANT SPEC SENTENCES \(spec version: (?<specVersion>\d+\.[0-9]\d*\-[0-9]\d*), test type: (?<testType>pos|neg)\):(?<testSpecSentenceList>(\n\s+\*\s+-\s+.*?)+)"""))
val relevantSpecSentencesPattern: Pattern =
Pattern.compile("""\n\s+\*\s+-\s+(?<specSections>.*?) -> paragraph (?<specParagraph>[1-9]\d*) -> sentence (?<specSentence>[1-9]\d*)""")
}
@@ -18,7 +18,7 @@ object HtmlSpecLoader {
private const val SPEC_DOCS_TC_CONFIGURATION_ID = "Kotlin_Spec_DocsMaster"
private const val TC_URL = "https://teamcity.jetbrains.com"
private const val TC_PATH_PREFIX = "guestAuth/app/rest/builds"
private const val HTML_SPEC_PATH = "/web/kotlin-spec.html"
private const val HTML_SPEC_PATH = "/html/kotlin-spec.html"
private const val STABLE_BRANCH = "master"
private fun loadRawHtmlSpec(specVersion: String, buildNumber: String): String {
@@ -9,20 +9,45 @@ import org.jetbrains.kotlin.generators.tests.generator.testGroup
import org.jetbrains.kotlin.spec.checkers.AbstractDiagnosticsTestSpec
import org.jetbrains.kotlin.spec.codegen.AbstractBlackBoxCodegenTestSpec
import org.jetbrains.kotlin.spec.parsing.AbstractParsingTestSpec
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TEST_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TESTDATA_PATH
import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TEST_PATH
import org.jetbrains.kotlin.spec.utils.TestsJsonMapGenerator
import org.jetbrains.kotlin.spec.utils.TestsJsonMapGenerator.TESTS_MAP_FILENAME
import java.io.File
import java.nio.file.Files
fun detectDirsWithTestsMapFileOnly(dirName: String): List<String> {
val excludedDirs = mutableListOf<String>()
File("$SPEC_TESTDATA_PATH/$dirName").walkTopDown().forEach { file ->
val listFiles = Files.walk(file.toPath()).filter(Files::isRegularFile)
if (file.isDirectory && listFiles?.allMatch { it.endsWith(TESTS_MAP_FILENAME) } == true) {
val relativePath = file.relativeTo(File("$SPEC_TESTDATA_PATH/$dirName")).path
if (!excludedDirs.any { relativePath.startsWith(it) }) {
excludedDirs.add(relativePath)
}
}
}
return excludedDirs
}
fun generateTests() {
testGroup(TEST_PATH, TESTDATA_PATH) {
testGroup(SPEC_TEST_PATH, SPEC_TESTDATA_PATH) {
testClass<AbstractDiagnosticsTestSpec> {
model("diagnostics", excludeDirs = listOf("helpers"))
model("diagnostics", excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"))
}
testClass<AbstractParsingTestSpec> {
model("psi", testMethod = "doParsingTest", excludeDirs = listOf("helpers", "templates"))
model(
relativeRootPath = "psi",
testMethod = "doParsingTest",
excludeDirs = listOf("helpers", "templates") + detectDirsWithTestsMapFileOnly("psi")
)
}
testClass<AbstractBlackBoxCodegenTestSpec> {
model("codegen/box", excludeDirs = listOf("helpers", "templates"))
model("codegen/box", excludeDirs = listOf("helpers", "templates") + detectDirsWithTestsMapFileOnly("codegen/box"))
}
}
}