[Spec tests] Fix tests

This commit is contained in:
anastasiia.spaseeva
2020-01-09 17:06:30 +03:00
parent 7dc469b32d
commit 94c008872e
12 changed files with 644 additions and 650 deletions
@@ -57,58 +57,6 @@
"casesNumber": 3,
"description": "check if-expressions must have both branches.",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check before",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckBefore.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive with nullability check else",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveWithNullabilityCheckElse.kt",
"unexpectedBehaviour": false
}
]
}
},
"2": {
"neg": {
"1": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "When type disjunctions",
"path": "compiler/testData/diagnostics/tests/when/WhenTypeDisjunctions.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive break continue",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveBreakContinue.kt",
"unexpectedBehaviour": false
}
]
},
"pos": {
"1": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive return throw",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturnThrow.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Exhaustive return",
"path": "compiler/testData/diagnostics/tests/when/ExhaustiveReturn.kt",
"unexpectedBehaviour": false
}
]
}
@@ -1,3 +1,4 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
// !LANGUAGE: +NewInference
// SKIP_TXT
@@ -11,35 +12,32 @@
* HELPERS: checkType
*/
// TESTCASE NUMBER: 1
fun foo() {
fun foo1() {
val proc = "case 1"
}
class Case1() {
checkType<Unit>(foo())
fun case1() {
foo1() checkType { check<Unit>() }
}
// TESTCASE NUMBER: 2
fun case2foo(m: String, bar: (m: String) -> Unit) {
bar(m)
fun case2foo(m: String, bar: () -> Unit) {
bar()
}
class Case2Boo {
fun buz(m: String) {
fun buz() {
val proc = "case 2"
}
}
class Case2() {
fun case2() {
val boo = Case2Boo()
val res = case2foo("s", boo::buz)
checkType<Unit>(res)
res checkType { check<Unit>() }
}
// TESTCASE NUMBER: 3
@@ -50,23 +48,20 @@ interface Processable<T> {
class Processor : Processable<Unit> {
override fun process() {
val proc = "case 3"
}
}
class Case3() {
fun case3() {
val p1 = Processor().process()
checkType<Unit>(p1)
p1 checkType { check<Unit>() }
}
// TESTCASE NUMBER: 4
class Case4() {
fun case4() {
val p2 = object : Processable<Unit> {
override fun process() {
val proc = "case 4"
}
}
checkType<Unit>(p2)
}
p2.process() checkType { check<Unit>() }
}
@@ -20,73 +20,5 @@
}
]
}
},
"4": {
"pos": {
"1": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10811",
"path": "compiler/testData/diagnostics/tests/when/kt10811.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10809",
"path": "compiler/testData/diagnostics/tests/when/kt10809.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
}
]
}
},
"5": {
"pos": {
"1": [
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9929",
"path": "compiler/testData/diagnostics/tests/when/kt9929.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt9972",
"path": "compiler/testData/diagnostics/tests/when/kt9972.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-152",
"casesNumber": 0,
"description": "Kt10439",
"path": "compiler/testData/diagnostics/tests/when/kt10439.kt",
"unexpectedBehaviour": false
}
]
}
}
}
@@ -6,12 +6,14 @@
"specVersion": "0.1-100",
"casesNumber": 11,
"description": "The use of Boolean literals as the identifier (with backtick) in the class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.2.kt",
"unexpectedBehaviour": false
},
{
"specVersion": "0.1-100",
"casesNumber": 9,
"description": "The use of Boolean literals as the identifier (with backtick) in the class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.1.kt",
"unexpectedBehaviour": false
}
]
@@ -6,6 +6,7 @@
"specVersion": "0.1-100",
"casesNumber": 13,
"description": "The use of Boolean literals as the identifier (with backtick) in the class.",
"path": "compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt",
"unexpectedBehaviour": false
}
]