Select runtime with directive in test data file instead of test name in PsiChecker tests

This commit is contained in:
Ilya Gorbunov
2016-09-02 20:06:20 +03:00
parent d103657e07
commit 8f3e6f38ed
8 changed files with 43 additions and 12 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
// RUNTIME
fun none() {}
fun unitEmptyInfer() {}
@@ -16,8 +17,8 @@ fun bbb() {
fun foo(<warning>expr</warning>: StringBuilder): Int {
val c = 'a'
when(c) {
0.toChar() -> throw Throwable("zero")
else -> throw Throwable("nonzero" + c)
0.toChar() -> throw Exception("zero")
else -> throw Exception("nonzero" + c)
}
}
+1
View File
@@ -1,3 +1,4 @@
// RUNTIME
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'class'">@JvmStatic</error>
class A {
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'companion object'">@JvmStatic</error>
@@ -1,3 +1,4 @@
// RUNTIME
@file:JvmName("TopLevelMultifile")
@file:JvmMultifileClass
package test
+4 -3
View File
@@ -1,3 +1,4 @@
// RUNTIME
import java.util.*
import java.io.*
@@ -9,15 +10,15 @@ fun takeFirst(expr: StringBuilder): Char {
}
fun evaluateArg(expr: CharSequence, numbers: ArrayList<Int>): Int {
if (expr.length == 0) throw Throwable("Syntax error: Character expected");
if (expr.length == 0) throw Exception("Syntax error: Character expected");
val c = takeFirst(<error>expr</error>)
if (c >= '0' && c <= '9') {
val n = c - '0'
if (!numbers.contains(n)) throw Throwable("You used incorrect number: " + n)
if (!numbers.contains(n)) throw Exception("You used incorrect number: " + n)
numbers.remove(n)
return n
}
throw Throwable("Syntax error: Unrecognized character " + c)
throw Exception("Syntax error: Unrecognized character " + c)
}
fun evaluateAdd(expr: StringBuilder, numbers: ArrayList<Int>): Int {