Add 'mute' concept: move tests with unexpected behaviour to the corresponding folder
This commit is contained in:
+5
-1
@@ -50,5 +50,9 @@ fun case_6(value_1: _EnumClass): String {
|
||||
}
|
||||
}
|
||||
|
||||
// CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty enum class.
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty enum class.
|
||||
DISCUSSION
|
||||
ISSUES: KT-26044
|
||||
*/
|
||||
fun case_7(value_1: _EnumClassEmpty): String = <!NO_ELSE_IN_WHEN!>when<!> (value_1) { }
|
||||
|
||||
+1
-29
@@ -64,15 +64,6 @@ fun case_8(value_1: _SealedClassMixed?): String = <!NO_ELSE_IN_WHEN!>when<!>(val
|
||||
_SealedMixedChildObject1 -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty nullable sealed class (without subtypes).
|
||||
UNEXPECTED BEHAVIOUR: must be exhaustive
|
||||
ISSUES: KT-26044
|
||||
*/
|
||||
fun case_9(value: _SealedClassEmpty?): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {
|
||||
null -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the nullable Any.
|
||||
DISCUSSION: maybe make exhaustive without else?
|
||||
@@ -82,28 +73,9 @@ fun case_10(value_1: Any?): String = <!NO_ELSE_IN_WHEN!>when<!> (value_1) {
|
||||
null -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on opposite types.
|
||||
UNEXPECTED BEHAVIOUR: must be exhaustive
|
||||
ISSUES: KT-22996
|
||||
*/
|
||||
fun case_11(value: _SealedClass?): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {
|
||||
is _SealedChild1, !is _SealedChild3?, <!USELESS_IS_CHECK!>is _SealedChild3?<!> -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on opposite types.
|
||||
UNEXPECTED BEHAVIOUR: must be exhaustive
|
||||
ISSUES: KT-22996
|
||||
*/
|
||||
fun case_12(value: _SealedClass?): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {
|
||||
is _SealedChild1, !is _SealedChild3 -> ""
|
||||
<!USELESS_IS_CHECK!>is _SealedChild3?<!> -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty sealed class (without subtypes).
|
||||
DISCUSSION
|
||||
ISSUES: KT-26044
|
||||
*/
|
||||
fun case_13(value: _SealedClassEmpty): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {}
|
||||
fun case_11(value: _SealedClassEmpty): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {}
|
||||
|
||||
-16
@@ -44,19 +44,3 @@ fun case_5(value_1: _EnumClassSingle?): String = <!NO_ELSE_IN_WHEN!>when<!>(valu
|
||||
fun case_6(value_1: _EnumClassSingle?): String = <!NO_ELSE_IN_WHEN!>when<!>(value_1) {
|
||||
null -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty nullable enum class.
|
||||
UNEXPECTED BEHAVIOUR
|
||||
ISSUES: KT-26044
|
||||
*/
|
||||
fun case_7(value: _EnumClassEmpty?): String = <!NO_ELSE_IN_WHEN!>when<!>(value) {
|
||||
null -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty enum class.
|
||||
DISCUSSION
|
||||
ISSUES: KT-26044
|
||||
*/
|
||||
fun case_13(value: _EnumClassEmpty): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {}
|
||||
|
||||
+19
@@ -64,3 +64,22 @@ fun case_6(value_1: _SealedClassMixed): String = when (value_1) {
|
||||
fun case_7(value_1: _SealedClassEmpty): String = when (value_1) {
|
||||
else -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on opposite types.
|
||||
UNEXPECTED BEHAVIOUR: must be exhaustive
|
||||
ISSUES: KT-22996
|
||||
*/
|
||||
fun case_8(value: _SealedClass?): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {
|
||||
is _SealedChild1, !is _SealedChild3?, <!USELESS_IS_CHECK!>is _SealedChild3?<!> -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on opposite types.
|
||||
UNEXPECTED BEHAVIOUR: must be exhaustive
|
||||
ISSUES: KT-22996
|
||||
*/
|
||||
fun case_9(value: _SealedClass?): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {
|
||||
is _SealedChild1, !is _SealedChild3 -> ""
|
||||
<!USELESS_IS_CHECK!>is _SealedChild3?<!> -> ""
|
||||
}
|
||||
|
||||
+9
@@ -24,3 +24,12 @@ fun case_2(value_1: _EnumClassSingle?): String = when (value_1) {
|
||||
_EnumClassSingle.EVERYTHING -> ""
|
||||
null -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty nullable enum class.
|
||||
UNEXPECTED BEHAVIOUR
|
||||
ISSUES: KT-26044
|
||||
*/
|
||||
fun case_3(value_1: _EnumClassEmpty?): String = <!NO_ELSE_IN_WHEN!>when<!>(value_1) {
|
||||
null -> ""
|
||||
}
|
||||
|
||||
+9
@@ -64,3 +64,12 @@ fun case_6(value_1: _SealedClassMixed?): String = when (value_1) {
|
||||
is _SealedMixedChildObject3 -> ""
|
||||
null -> ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking for not exhaustive 'when' on the empty nullable sealed class (without subtypes).
|
||||
UNEXPECTED BEHAVIOUR: must be exhaustive
|
||||
ISSUES: KT-26044
|
||||
*/
|
||||
fun case_7(value: _SealedClassEmpty?): String = <!NO_ELSE_IN_WHEN!>when<!> (value) {
|
||||
null -> ""
|
||||
}
|
||||
|
||||
+2
-14
@@ -51,11 +51,7 @@ fun case_2(value_1: Int): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking all types except the correct one (numbers) in 'when' without bound value.
|
||||
UNEXPECTED BEHAVIOUR
|
||||
ISSUES: KT-25268
|
||||
*/
|
||||
// CASE DESCRIPTION: Checking all types except the correct one (numbers) in 'when' without bound value.
|
||||
fun case_3(value_1: Int): String {
|
||||
val whenValue = when {
|
||||
value_1 == 0 -> <!IMPLICIT_CAST_TO_ANY!>1 + 1<!>
|
||||
@@ -72,23 +68,17 @@ fun case_3(value_1: Int): String {
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Float>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Number>() } // unexpected behaviour!
|
||||
checkSubtype<Int>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Long>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Double>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Float>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Short>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Byte>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Number>(<!TYPE_MISMATCH!>whenValue<!>) // unexpected behaviour!
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
/*
|
||||
CASE DESCRIPTION: Checking all types except the correct one (numbers) in 'when' with bound value.
|
||||
UNEXPECTED BEHAVIOUR
|
||||
ISSUES: KT-25268
|
||||
*/
|
||||
// CASE DESCRIPTION: Checking all types except the correct one (numbers) in 'when' with bound value.
|
||||
fun case_4(value_1: Int): String {
|
||||
val whenValue = when (value_1) {
|
||||
0 -> <!IMPLICIT_CAST_TO_ANY!>1 + 1<!>
|
||||
@@ -105,14 +95,12 @@ fun case_4(value_1: Int): String {
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Float>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Number>() } // unexpected behaviour!
|
||||
checkSubtype<Int>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Long>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Double>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Float>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Short>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Byte>(<!TYPE_MISMATCH!>whenValue<!>)
|
||||
checkSubtype<Number>(<!TYPE_MISMATCH!>whenValue<!>) // unexpected behaviour!
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
+4
@@ -57,6 +57,8 @@ fun case_3(value_1: Int): String {
|
||||
}
|
||||
|
||||
whenValue checkType { _<Any>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Number>() } // unexpected behaviour!
|
||||
checkSubtype<Number>(<!TYPE_MISMATCH!>whenValue<!>) // unexpected behaviour!
|
||||
|
||||
return ""
|
||||
}
|
||||
@@ -77,6 +79,8 @@ fun case_4(value_1: Int): String {
|
||||
}
|
||||
|
||||
whenValue checkType { _<Any>() }
|
||||
whenValue checkType { <!TYPE_MISMATCH!>_<!><Number>() } // unexpected behaviour!
|
||||
checkSubtype<Number>(<!TYPE_MISMATCH!>whenValue<!>) // unexpected behaviour!
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user