[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
@@ -1,4 +1,11 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 5
* - annotations, annotation-targets -> paragraph 1 -> sentence 1
*/
fun foo(a: Int) {
@ann
when (a) {
@@ -1,4 +1,12 @@
// !WITH_NEW_INFERENCE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 6
*/
class A
fun test(a: Any): String {
@@ -1,4 +1,12 @@
// !WITH_NEW_INFERENCE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 8
*/
class A
fun test(a: Any) {
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 8
*/
enum class My { A, B }
fun test(a: My): String {
@@ -7,6 +15,6 @@ fun test(a: My): String {
My.A -> q = "1"
My.B -> q = "2"
}<!>
// When is exhaustive
// When is exhaustives
return <!DEBUG_INFO_SMARTCAST!>q<!>
}
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 8
*/
class A
fun test(a: Any): String {
@@ -7,6 +15,6 @@ fun test(a: Any): String {
is A -> q = "1"
else -> q = "2"
}
// When is not exhaustive
// When is exhaustives
return <!DEBUG_INFO_SMARTCAST!>q<!>
}
@@ -1,3 +1,8 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 5 -> sentence 1
*/
fun foo(x: Int, y: Int): Int =
when {
x > 0<!COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT!>,<!> y > 0<!COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT!>,<!><!SYNTAX!>,<!> x < 0 -> 1
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 1
* - expressions, when-expression -> paragraph 2 -> sentence 4
* - expressions, when-expression -> paragraph 2 -> sentence 5
*/
package test
const val four = 4
@@ -1,4 +1,10 @@
// KT-2902 Check for null should be required when match nullable enum element
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
*/
// FILE: 1.kt
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
*/
enum class E { A, B }
fun foo(e: E, something: Any?): Int {
@@ -1,4 +1,12 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 1 -> sentence 1
* - expressions, when-expression -> paragraph 1 -> sentence 2
* - expressions, when-expression -> paragraph 6 -> sentence 5
*/
// EA-68871: empty when condition
fun foo(arg: Int): Int {
when (arg) {
@@ -1,4 +1,12 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 1 -> sentence 1
* - expressions, when-expression -> paragraph 1 -> sentence 2
* - expressions, when-expression -> paragraph 6 -> sentence 5
*/
// EA-68871: empty when condition
enum class My { FIRST, SECOND }
fun foo(arg: My): Int {
@@ -1,4 +1,12 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
*/
// See also: KT-3743
fun foo(arg: Boolean): String {
// Must be exhaustive
@@ -1,4 +1,12 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
*/
fun foo(arg: Boolean): String {
// Must be exhaustive
return when(arg) {
@@ -1,4 +1,12 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
*/
// See also: KT-3743
fun foo(arg: Boolean): String {
// Must be exhaustive
@@ -1,4 +1,12 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
*/
// See also: KT-3743
fun foo(arg: Boolean?): String {
// Must be exhaustive
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
* - control--and-data-flow-analysis, control-flow-graph, statements-1 -> paragraph 0 -> sentence 0
*/
enum class Color { RED, GREEN, BLUE }
fun foo(arr: Array<Color>): Color {
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
*/
enum class MyEnum {
A, B, C
}
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 5
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
*/
enum class MyEnum {
A, B, C
}
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 5
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
*/
enum class Direction {
NORTH, SOUTH, WEST, EAST
}
@@ -12,4 +21,4 @@ fun foo(dir: Direction): Int {
Direction.EAST -> res = 4
}<!>
return res
}
}
@@ -1,3 +1,13 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
*/
fun foo(b: Boolean): Int {
val x: Int
val y: Int
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
*/
enum class MyEnum {
A, B
}
@@ -1,3 +1,9 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
*/
// See KT-6399: exhaustive whens on platform enums
// FILE: J.java
@@ -1,4 +1,10 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
*/
// See KT-6399: exhaustive whens on platform enums
// FILE: J.java
@@ -1,4 +1,11 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
*/
// See KT-6399: exhaustive whens on platform enums
// FILE: J.java
@@ -1,4 +1,11 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
*/
// See KT-6399: exhaustive whens on platform enums
// FILE: J.java
@@ -1,3 +1,9 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
*/
// See KT-6399: exhaustive whens on platform enums
// FILE: J.java
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
*/
enum class Direction {
NORTH, SOUTH, WEST, EAST
}
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
*/
enum class Direction {
NORTH, SOUTH, WEST, EAST
}
@@ -1,3 +1,13 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 3
*/
fun foo(a: Boolean, b: Boolean): Int {
val x: Int
if (a) {
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
*/
fun foo(a: Boolean, b: Boolean): Int {
var x: Int
if (a) {
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
*/
// KT-7857: when exhaustiveness does not take previous nullability checks into account
enum class X { A, B }
fun foo(arg: X?): Int {
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
*/
// KT-7857: when exhaustiveness does not take previous nullability checks into account
enum class X { A, B }
fun foo(arg: X?): Int {
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 4
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 5
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
*/
// KT-7857: when exhaustiveness does not take previous nullability checks into account
fun foo(arg: Boolean?): Int {
if (arg != null) {
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
*/
// KT-7857: when exhaustiveness does not take previous nullability checks into account
enum class X { A, B }
fun foo(arg: X?): Int {
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
*/
fun foo(x: Int) {
val y: Unit = <!NO_ELSE_IN_WHEN!>when<!> (x) {
2 -> {}
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
*/
fun foo(x: Int): Any {
val v = <!NO_ELSE_IN_WHEN!>when<!> (x) {
2 -> 0
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, function-literals, lambda-literals -> paragraph 10 -> sentence 1
*/
fun foo(x: Int) {
r {
when (x) {
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, function-literals, lambda-literals -> paragraph 10 -> sentence 1
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 3 -> sentence 3
*/
fun foo(x: Int) {
r {
<!NO_ELSE_IN_WHEN!>when<!> (x) {
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
*/
fun foo(x: Int): Any {
return <!NO_ELSE_IN_WHEN!>when<!> (x) {
2 -> 0
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
*/
fun foo(x: Int) {
return <!NO_ELSE_IN_WHEN!>when<!> (x) {
2 -> {}
@@ -1,4 +1,10 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 2
*/
fun foo(x: Int) {
when (x) {
2 -> {}
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
*/
// See also: KT-3743
fun foo(arg: Boolean?): String {
// Must be NOT exhaustive
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
*/
// See KT-6399: exhaustive whens on platform enums
// FILE: J.java
@@ -1,3 +1,13 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
*/
// Base for KT-6227
enum class X { A, B, C, D }
@@ -1,4 +1,14 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
*/
// Base for KT-6227
enum class X { A, B, C, D }
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
*/
// Base for KT-6227
enum class X { A, B, C, D }
@@ -1,3 +1,14 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 7
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 3 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
*/
sealed class S
object First : S()
@@ -1,4 +1,15 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
*/
// Base for KT-6227
enum class X { A, B, C, D }
@@ -1,3 +1,12 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression -> paragraph 9 -> sentence 2
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
*/
// KT-7857: when exhaustiveness does not take previous nullability checks into account
enum class X { A, B }
fun foo(arg: X?): Int {
@@ -1,3 +1,13 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 2 -> sentence 3
* - control--and-data-flow-analysis, performing-analysis-on-the-control-flow-graph, variable-initialization-analysis -> paragraph 3 -> sentence 2
* - declarations, classifier-declaration, classifier-initialization -> paragraph 6 -> sentence 4
*/
// See KT-5113
enum class E {
A,
@@ -1,3 +1,13 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 9
* - expressions, when-expression -> paragraph 6 -> sentence 10
* - expressions, when-expression -> paragraph 6 -> sentence 11
*/
// FILE: MyEnum.java
public enum MyEnum {
SINGLE;
@@ -1,3 +1,10 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
*/
// !DIAGNOSTICS: -UNUSED_PARAMETER
infix fun Any.sealed(a: Any?) {}
@@ -1,4 +1,12 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 6
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 7
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 8
*/
sealed class A {
class B: A() {
+12
View File
@@ -1,4 +1,16 @@
// !WITH_NEW_INFERENCE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 2 -> sentence 5
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 3
* - expressions, when-expression -> paragraph 6 -> sentence 5
* - expressions, when-expression -> paragraph 6 -> sentence 9
* - expressions, when-expression -> paragraph 6 -> sentence 10
* - expressions, when-expression -> paragraph 6 -> sentence 11
*/
fun Int.foo() : Boolean = true
fun foo() : Int {
@@ -1,3 +1,13 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1
* - control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0
*/
fun foo(s: Any): String {
val x = when (s) {
is String -> <!DEBUG_INFO_SMARTCAST!>s<!>
+10
View File
@@ -1,4 +1,14 @@
// !WITH_NEW_INFERENCE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 1
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
* - expressions, conditional-expression -> paragraph 5 -> sentence 1
* - overload-resolution, determining-function-applicability-for-a-specific-call, rationale -> paragraph 1 -> sentence 1
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 3 -> sentence 1
*/
fun foo(x: Int) = x
fun test0(flag: Boolean) {
+14
View File
@@ -1,6 +1,20 @@
// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEBUG_INFO_SMARTCAST
// NI_EXPECTED_FILE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 1
* - expressions, when-expression -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
* - declarations, function-declaration -> paragraph 7 -> sentence 1
* - type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
* - type-system, type-kinds, type-parameters -> paragraph 4 -> sentence 1
* - type-inference, local-type-inference -> paragraph 8 -> sentence 1
* - type-inference, local-type-inference -> paragraph 2 -> sentence 1
*/
interface Data
interface Item
+13
View File
@@ -1,4 +1,17 @@
// FIR_IDENTICAL
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
* - type-inference, local-type-inference -> paragraph 8 -> sentence 1
* - type-inference, local-type-inference -> paragraph 2 -> sentence 1
* - type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 3
* - type-system, subtyping, subtyping-for-nullable-types -> paragraph 4 -> sentence 1
* - type-system, subtyping, subtyping-for-nullable-types -> paragraph 4 -> sentence 2
*/
interface Maybe<T>
class Some<T>(val value: T) : Maybe<T>
class None<T> : Maybe<T>
+8
View File
@@ -1,3 +1,11 @@
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 5 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 6 -> sentence 5
*/
// KT-4434 Missed diagnostic about else branch in when
package test
+9
View File
@@ -1,4 +1,13 @@
// !WITH_NEW_INFERENCE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: pos):
* - expressions, when-expression -> paragraph 2 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - expressions, when-expression -> paragraph 9 -> sentence 1
* - expressions, conditional-expression -> paragraph 4 -> sentence 1
* - expressions, conditional-expression -> paragraph 5 -> sentence 1
*/
fun test1(): Int {
val x: String = <!NI;TYPE_MISMATCH!>if (true) {
when {
@@ -1,4 +1,13 @@
// !WITH_NEW_INFERENCE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 2 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - type-system, subtyping, subtyping-rules -> paragraph 2 -> sentence 1
* - type-inference, local-type-inference -> paragraph 2 -> sentence 1
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 3 -> sentence 3
*/
val test1: (String) -> Boolean =
when {
true -> {{ true }}
@@ -1,5 +1,15 @@
// !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE
/*
* RELEVANT SPEC SENTENCES (spec version: 0.1-155, test type: neg):
* - expressions, when-expression -> paragraph 2 -> sentence 1
* - expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 1
* - declarations, function-declaration -> paragraph 7 -> sentence 1
* - declarations, function-declaration -> paragraph 7 -> sentence 2
* - declarations, function-declaration -> paragraph 8 -> sentence 1
* - overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 1 -> sentence 3
*/
val <!OI;IMPLICIT_NOTHING_PROPERTY_TYPE!>test1<!> = when {
true -> { <!OI;TYPE_MISMATCH!>{ true }<!> }
else -> TODO()
@@ -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"))
}
}
}