Select runtime with directive in test data file instead of test name in PsiChecker tests
This commit is contained in:
+3
-2
@@ -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,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>
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// RUNTIME
|
||||
@file:JvmName("TopLevelMultifile")
|
||||
@file:JvmMultifileClass
|
||||
package test
|
||||
|
||||
+4
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user