Minor, tests: Move EXPECTED_ERROR directives to the file end (to preserve stable line numbers)

This commit is contained in:
Yan Zhulanow
2018-09-05 17:40:55 +03:00
parent c517b85de1
commit 72637268c6
9 changed files with 43 additions and 41 deletions
@@ -1,17 +1,5 @@
// CORRECT_ERROR_TYPES
// EXPECTED_ERROR(kotlin:18:1) cannot find symbol
// EXPECTED_ERROR(kotlin:21:34) cannot find symbol
// EXPECTED_ERROR(kotlin:21:50) cannot find symbol
// EXPECTED_ERROR(kotlin:21:62) cannot find symbol
// EXPECTED_ERROR(kotlin:23:1) cannot find symbol
// EXPECTED_ERROR(kotlin:24:1) cannot find symbol
// EXPECTED_ERROR(kotlin:28:5) cannot find symbol
// EXPECTED_ERROR(kotlin:29:5) cannot find symbol
// EXPECTED_ERROR(kotlin:32:5) cannot find symbol
// EXPECTED_ERROR(kotlin:34:5) cannot find symbol
// EXPECTED_ERROR(kotlin:37:5) cannot find symbol
@file:Suppress("UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION")
import kotlin.reflect.KClass
@@ -37,4 +25,16 @@ class ErrorInDeclarations {
fun f4(): ABC? = null
}
annotation class Anno(val a: KClass<Any>)
annotation class Anno(val a: KClass<Any>)
// EXPECTED_ERROR(kotlin:11:1) cannot find symbol
// EXPECTED_ERROR(kotlin:12:1) cannot find symbol
// EXPECTED_ERROR(kotlin:16:5) cannot find symbol
// EXPECTED_ERROR(kotlin:17:5) cannot find symbol
// EXPECTED_ERROR(kotlin:20:5) cannot find symbol
// EXPECTED_ERROR(kotlin:22:5) cannot find symbol
// EXPECTED_ERROR(kotlin:25:5) cannot find symbol
// EXPECTED_ERROR(kotlin:6:1) cannot find symbol
// EXPECTED_ERROR(kotlin:9:34) cannot find symbol
// EXPECTED_ERROR(kotlin:9:50) cannot find symbol
// EXPECTED_ERROR(kotlin:9:62) cannot find symbol
@@ -1,5 +1,4 @@
// CORRECT_ERROR_TYPES
// EXPECTED_ERROR(kotlin:17:5) cannot find symbol
// FILE: a.kt
package test
@@ -51,4 +50,6 @@ interface TestC {
fun d(): LibIOException
fun e(): LibFooBar
}
}
// EXPECTED_ERROR(kotlin:17:5) cannot find symbol
@@ -1,9 +1,9 @@
// EXPECTED_ERROR(kotlin:8:1) cannot find symbol
// EXPECTED_ERROR(other:-1:-1) 'WHI-TE' is an invalid Java enum value name
enum class Color {
BLACK, `WHI-TE`
}
@Anno(Color.`WHI-TE`)
annotation class Anno(val color: Color)
annotation class Anno(val color: Color)
// EXPECTED_ERROR(kotlin:5:1) cannot find symbol
// EXPECTED_ERROR(other:-1:-1) 'WHI-TE' is an invalid Java enum value name
+6 -6
View File
@@ -1,8 +1,3 @@
// EXPECTED_ERROR class B is public, should be declared in a file named B.java
// EXPECTED_ERROR class R is public, should be declared in a file named R.java
// EXPECTED_ERROR class R is public, should be declared in a file named R.java
// EXPECTED_ERROR class R2 is public, should be declared in a file named R2.java
//FILE: lib/R.java
package lib;
@@ -87,4 +82,9 @@ class MyActivity {
@Bind(B.id.textView)
fun plainIntConstant() {}
}
}
// EXPECTED_ERROR class B is public, should be declared in a file named B.java
// EXPECTED_ERROR class R is public, should be declared in a file named R.java
// EXPECTED_ERROR class R is public, should be declared in a file named R.java
// EXPECTED_ERROR class R2 is public, should be declared in a file named R2.java
+4 -4
View File
@@ -1,8 +1,5 @@
// STRICT_MODE
// EXPECTED_ERROR(kotlin:12:9) cannot find symbol
// EXPECTED_ERROR(other:-1:-1) Can't generate a stub for 'Foo$Bar$Bar'.
class Foo(private val string: String) {
val bar = Bar("bar")
@@ -11,4 +8,7 @@ class Foo(private val string: String) {
val bars: ArrayList<Bar> = ArrayList()
}
}
}
// EXPECTED_ERROR(kotlin:9:9) cannot find symbol
// EXPECTED_ERROR(other:-1:-1) Can't generate a stub for 'Foo$Bar$Bar'.
@@ -1,5 +1,4 @@
// CORRECT_ERROR_TYPES
// EXPECTED_ERROR(kotlin:9:5) cannot find symbol
// JAVAC_OPTION -Xmaxerrs=1
@file:Suppress("UNRESOLVED_REFERENCE")
@@ -10,4 +9,6 @@ class Test {
}
// There are two errors (unresolved identifier ABC, BCD) actually.
// But we specified the max error count, so the error output is limited.
// But we specified the max error count, so the error output is limited.
// EXPECTED_ERROR(kotlin:8:5) cannot find symbol
@@ -1,6 +1,3 @@
// EXPECTED_ERROR class J$B is public, should be declared in a file named J$B.java
// EXPECTED_ERROR class JavaClass is public, should be declared in a file named JavaClass.java
// FILE: JavaClass.java
public class JavaClass {
public class Foo {
@@ -78,4 +75,7 @@ class `A$B` {
class Test1(val zoo: Foo.Bar.Zoo) : Foo.Bar(), IFoo.IBar, IFoo.IBar.IZoo {
fun a(): Thread.State = Thread.State.NEW
fun b(foo: JavaClass.Foo, bar: JavaClass.Foo.Bar) {}
}
}
// EXPECTED_ERROR class J$B is public, should be declared in a file named J$B.java
// EXPECTED_ERROR class JavaClass is public, should be declared in a file named JavaClass.java
@@ -1,5 +1,3 @@
// EXPECTED_ERROR class J$B is public, should be declared in a file named J$B.java
// FILE: test/JavaClass.java
package test;
@@ -83,4 +81,6 @@ class `A$B` {
class Test1(val zoo: Foo.Bar.Zoo) : Foo.Bar(), IFoo.IBar, IFoo.IBar.IZoo {
fun a(): Thread.State = Thread.State.NEW
fun b(foo: JavaClass.Foo, bar: JavaClass.Foo.Bar) {}
}
}
// EXPECTED_ERROR class J$B is public, should be declared in a file named J$B.java
@@ -1,5 +1,3 @@
// EXPECTED_ERROR(other:-1:-1) '60x60' is an invalid Java enum value name
class `:)` {
lateinit val f: String
}
@@ -37,4 +35,6 @@ class `!A@`
class `A()B()`
class `A B` {
class C
}
}
// EXPECTED_ERROR(other:-1:-1) '60x60' is an invalid Java enum value name