j2k: flatten test cases and testData directory structure
Move j2k/test/tests -> j2k/tests, j2k/test/testData -> j2k/testData
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@interface Anon {
|
||||
String[] stringArray();
|
||||
|
||||
int[] intArray();
|
||||
|
||||
// string
|
||||
String string();
|
||||
}
|
||||
|
||||
@Anon(string = "a", stringArray = { "a", "b" }, intArray = { 1, 2 })
|
||||
@Target({ElementType.CONSTRUCTOR, ElementType.FIELD})
|
||||
@interface I {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.lang.annotation.ElementType
|
||||
import java.lang.annotation.Target
|
||||
|
||||
annotation class Anon(public val stringArray: Array<String>, public val intArray: IntArray, // string
|
||||
public val string: String)
|
||||
|
||||
Anon(string = "a", stringArray = array("a", "b"), intArray = intArray(1, 2))
|
||||
Target(ElementType.CONSTRUCTOR, ElementType.FIELD)
|
||||
annotation class I
|
||||
@@ -0,0 +1,8 @@
|
||||
@interface Anon {
|
||||
String s() default "a";
|
||||
String[] stringArray() default { "a", "b" };
|
||||
int[] intArray();
|
||||
}
|
||||
|
||||
@Anon(intArray = {1, 2})
|
||||
class A{ }
|
||||
@@ -0,0 +1,4 @@
|
||||
annotation class Anon(public val s: String = "a", public val stringArray: Array<String> = array("a", "b"), public vararg val intArray: Int)
|
||||
|
||||
Anon(intArray = *intArray(1, 2))
|
||||
class A
|
||||
@@ -0,0 +1,14 @@
|
||||
@interface Anon {
|
||||
String value();
|
||||
|
||||
enum E {
|
||||
A, B
|
||||
}
|
||||
|
||||
E field = E.A;
|
||||
}
|
||||
|
||||
@Anon("a")
|
||||
interface I {
|
||||
Anon.E e = Anon.field;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// ERROR: Body is not allowed for annotation class
|
||||
annotation class Anon(public val value: String) {
|
||||
|
||||
public enum class E {
|
||||
A
|
||||
B
|
||||
}
|
||||
|
||||
class object {
|
||||
|
||||
public val field: E = E.A
|
||||
}
|
||||
}
|
||||
|
||||
Anon("a")
|
||||
trait I {
|
||||
class object {
|
||||
public val e: Anon.E = Anon.field
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import javaApi.*;
|
||||
|
||||
@Anon1(value = {"a"}, stringArray = {"b"}, intArray = {1, 2}, string = "x")
|
||||
@Anon2(value = "a", intValue = 1, charValue = 'a')
|
||||
@Anon3(e = E.A, stringArray = {}, value = {"a", "b"})
|
||||
@Anon4({"x", "y"})
|
||||
@Anon5(1)
|
||||
@Anon6({"x", "y"})
|
||||
@Anon7({ String.class, StringBuilder.class })
|
||||
@Anon8(classes = { String.class, StringBuilder.class })
|
||||
class C {
|
||||
@Anon5(1) @Deprecated private int field1 = 0;
|
||||
|
||||
@Anon5(1)
|
||||
private int field2 = 0;
|
||||
|
||||
@Anon5(1) int field3 = 0;
|
||||
|
||||
@Anon5(1)
|
||||
int field4 = 0;
|
||||
|
||||
@Anon6({})
|
||||
void foo(@Deprecated int p1, @Deprecated @Anon5(2) char p2) {
|
||||
@Deprecated @Anon5(3) char c = 'a';
|
||||
}
|
||||
|
||||
@Anon5(1) void bar(){}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import javaApi.*
|
||||
|
||||
Anon1(value = array("a"), stringArray = array("b"), intArray = intArray(1, 2), string = "x")
|
||||
Anon2(value = "a", intValue = 1, charValue = 'a')
|
||||
Anon3(e = E.A, stringArray = array(), value = *array("a", "b"))
|
||||
Anon4("x", "y")
|
||||
Anon5(1)
|
||||
Anon6(array("x", "y"))
|
||||
Anon7(javaClass<String>(), javaClass<StringBuilder>())
|
||||
Anon8(classes = *array(javaClass<String>(), javaClass<StringBuilder>()))
|
||||
class C {
|
||||
Anon5(1) deprecated("") private val field1 = 0
|
||||
|
||||
Anon5(1)
|
||||
private val field2 = 0
|
||||
|
||||
Anon5(1) var field3 = 0
|
||||
|
||||
Anon5(1)
|
||||
var field4 = 0
|
||||
|
||||
Anon6(array())
|
||||
fun foo(deprecated("") p1: Int, deprecated("") Anon5(2) p2: Char) {
|
||||
[deprecated("")] [Anon5(3)] val c = 'a'
|
||||
}
|
||||
|
||||
Anon5(1) fun bar() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// !forceNotNullTypes: false
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Test {
|
||||
@NotNull String myStr = "String2";
|
||||
|
||||
public Test(@NotNull String str) {
|
||||
myStr = str;
|
||||
}
|
||||
|
||||
public void sout(@NotNull String str) {
|
||||
// UNNECESSARY_NOT_NULL_ASSERTION heuristic does not work any more, instead we can skip generating !! altogether
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String dummy(@NotNull String str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
sout("String");
|
||||
@NotNull String test = "String2";
|
||||
sout(test);
|
||||
sout(dummy(test));
|
||||
|
||||
new Test(test);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// !forceNotNullTypes: false
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
package test
|
||||
|
||||
public class Test(str: String) {
|
||||
var myStr = "String2"
|
||||
|
||||
{
|
||||
myStr = str
|
||||
}
|
||||
|
||||
public fun sout(str: String) {
|
||||
// UNNECESSARY_NOT_NULL_ASSERTION heuristic does not work any more, instead we can skip generating !! altogether
|
||||
System.out!!.println(str)
|
||||
}
|
||||
|
||||
public fun dummy(str: String): String {
|
||||
return str
|
||||
}
|
||||
|
||||
public fun test() {
|
||||
sout("String")
|
||||
val test: String = "String2"
|
||||
sout(test)
|
||||
sout(dummy(test))
|
||||
|
||||
Test(test)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// !forceNotNullTypes: false
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class Foo {
|
||||
void execute() {}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
@NotNull
|
||||
Foo fooNotNull = new Foo();
|
||||
Foo fooNullable = null;
|
||||
}
|
||||
|
||||
class Test {
|
||||
public void test(@NotNull Bar barNotNull, Bar barNullable) {
|
||||
barNotNull.fooNotNull.execute();
|
||||
barNotNull.fooNullable.execute();
|
||||
barNullable.fooNotNull.execute();
|
||||
barNullable.fooNullable.execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// !forceNotNullTypes: false
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
package test
|
||||
|
||||
class Foo {
|
||||
fun execute() {
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
var fooNotNull = Foo()
|
||||
var fooNullable: Foo? = null
|
||||
}
|
||||
|
||||
class Test {
|
||||
public fun test(barNotNull: Bar, barNullable: Bar?) {
|
||||
barNotNull.fooNotNull.execute()
|
||||
barNotNull.fooNullable!!.execute()
|
||||
barNullable!!.fooNotNull.execute()
|
||||
barNullable.fooNullable!!.execute()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class Test {
|
||||
@Nullable String myStr = "String2";
|
||||
|
||||
public Test(@Nullable String str) {
|
||||
myStr = str;
|
||||
}
|
||||
|
||||
public void sout(@Nullable String str) {
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String dummy(@Nullable String str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
sout("String");
|
||||
@Nullable String test = "String2";
|
||||
sout(test);
|
||||
sout(dummy(test));
|
||||
|
||||
new Test(test);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
package test
|
||||
|
||||
public class Test(str: String?) {
|
||||
var myStr: String? = "String2"
|
||||
|
||||
{
|
||||
myStr = str
|
||||
}
|
||||
|
||||
public fun sout(str: String?) {
|
||||
System.out.println(str)
|
||||
}
|
||||
|
||||
public fun dummy(str: String?): String? {
|
||||
return str
|
||||
}
|
||||
|
||||
public fun test() {
|
||||
sout("String")
|
||||
val test: String? = "String2"
|
||||
sout(test)
|
||||
sout(dummy(test))
|
||||
|
||||
Test(test)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user