Add boolean literals diagnostic spec tests

This commit is contained in:
victor.petukhov
2018-10-31 13:07:22 +03:00
parent 1af1eed31c
commit 73ecde6cc3
7 changed files with 142 additions and 0 deletions
@@ -0,0 +1,24 @@
// !CHECK_TYPE
/*
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
*
* SECTIONS: constant-literals, boolean-literals
* PARAGRAPH: 1
* SENTENCE: [3] These are strong keywords which cannot be used as identifiers unless [escaped][Escaped identifiers].
* NUMBER: 1
* DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class.
* NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY
*/
// TESTCASE NUMBER: 1
fun case_1() {
true checkType { <!TYPE_MISMATCH!>_<!><Boolean?>() }
false checkType { <!TYPE_MISMATCH!>_<!><Boolean?>() }
true checkType { <!TYPE_MISMATCH!>_<!><Any?>() }
false checkType { <!TYPE_MISMATCH!>_<!><Any>() }
true checkType { <!TYPE_MISMATCH!>_<!><Nothing?>() }
false checkType { <!TYPE_MISMATCH!>_<!><Nothing>() }
}
@@ -0,0 +1,3 @@
package
public fun case_1(): kotlin.Unit
@@ -0,0 +1,21 @@
// !CHECK_TYPE
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SECTIONS: constant-literals, boolean-literals
* PARAGRAPH: 1
* SENTENCE: [3] These are strong keywords which cannot be used as identifiers unless [escaped][Escaped identifiers].
* NUMBER: 1
* DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class.
* NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY
*/
// TESTCASE NUMBER: 1
fun case_1() {
true checkType { _<Boolean>() }
false checkType { _<Boolean>() }
checkSubtype<Boolean>(true)
checkSubtype<Boolean>(false)
}
@@ -0,0 +1,3 @@
package
public fun case_1(): kotlin.Unit
@@ -0,0 +1,21 @@
// !CHECK_TYPE
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SECTIONS: constant-literals, boolean-literals
* PARAGRAPH: 1
* SENTENCE: [3] These are strong keywords which cannot be used as identifiers unless [escaped][Escaped identifiers].
* NUMBER: 2
* DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class.
* NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY
*/
// TESTCASE NUMBER: 1
fun case_1() {
checkSubtype<Boolean?>(true)
checkSubtype<Boolean?>(false)
checkSubtype<Any>(true)
checkSubtype<Any>(false)
}
@@ -0,0 +1,3 @@
package
public fun case_1(): kotlin.Unit