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)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
String str;
|
||||
{
|
||||
str = "Ola";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
var str: String
|
||||
{
|
||||
str = "Ola"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
static String str;
|
||||
static {
|
||||
str = "Ola";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
class object {
|
||||
var str: String
|
||||
{
|
||||
str = "Ola"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
myArray[myLibrary.calculateIndex(100)]
|
||||
@@ -0,0 +1 @@
|
||||
myArray[myLibrary.calculateIndex(100)]
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
myArray[10]
|
||||
@@ -0,0 +1 @@
|
||||
myArray[10]
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
myArray[i]
|
||||
@@ -0,0 +1 @@
|
||||
myArray[i]
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
double[] a = new double[]{1.0, 2, 3}
|
||||
@@ -0,0 +1 @@
|
||||
val a = doubleArray(1.0, 2.0, 3.0)
|
||||
@@ -0,0 +1,3 @@
|
||||
//statement
|
||||
double a = 0, b = 0, c = 0;
|
||||
double ds[] = {a, b, c};
|
||||
@@ -0,0 +1,4 @@
|
||||
val a = 0
|
||||
val b = 0
|
||||
val c = 0
|
||||
val ds = doubleArray(a.toDouble(), b.toDouble(), c.toDouble())
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
float[] a = new float[]{1, 2, 3.0}
|
||||
@@ -0,0 +1 @@
|
||||
val a = floatArray(1.0, 2.0, 3.0)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int[] a = new int[10]
|
||||
@@ -0,0 +1 @@
|
||||
val a = IntArray(10)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
java.lang.Double[] a = new java.lang.Double[]{1, 2, 3};
|
||||
@@ -0,0 +1 @@
|
||||
val a = array(1.0, 2.0, 3.0)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
java.lang.Float[] a = new java.lang.Float[]{1, 2, 3};
|
||||
@@ -0,0 +1 @@
|
||||
val a = array<Float>(1.0, 2.0, 3.0)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
byte[] a = new byte[] {1, 2, 3};
|
||||
@@ -0,0 +1 @@
|
||||
val a = byteArray(1, 2, 3)
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
new int[] {1, 2, 3};
|
||||
@@ -0,0 +1 @@
|
||||
intArray(1, 2, 3)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
Object[] a = new Object[10]
|
||||
@@ -0,0 +1 @@
|
||||
val a = arrayOfNulls<Any>(10)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int[] a = {1, 2, 3};
|
||||
@@ -0,0 +1 @@
|
||||
val a = intArray(1, 2, 3)
|
||||
@@ -0,0 +1,3 @@
|
||||
//statement
|
||||
int a = 0, b = 0, c = 0;
|
||||
int is[] = {a, b, c};
|
||||
@@ -0,0 +1,4 @@
|
||||
val a = 0
|
||||
val b = 0
|
||||
val c = 0
|
||||
val `is` = intArray(a, b, c)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int[][] a = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
|
||||
@@ -0,0 +1 @@
|
||||
val a = array(intArray(1, 2, 3), intArray(4, 5, 6), intArray(7, 8, 9))
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int [][] d2 = new int[][]{};
|
||||
@@ -0,0 +1 @@
|
||||
val d2 = array<IntArray>()
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int [][] d2 = new int[5][];
|
||||
@@ -0,0 +1 @@
|
||||
val d2 = arrayOfNulls<IntArray>(5)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int [][][] d3 = new int[5][5][];
|
||||
@@ -0,0 +1 @@
|
||||
val d3 = Array<Array<IntArray>>(5, { arrayOfNulls<IntArray>(5) })
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int [][] d2 = new int[5][5];
|
||||
+1
@@ -0,0 +1 @@
|
||||
val d2 = Array(5, { IntArray(5) })
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
String [][] ss = new String[5][5];
|
||||
@@ -0,0 +1 @@
|
||||
val ss = Array<Array<String>>(5, { arrayOfNulls<String>(5) })
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
String [][][] sss = new String[5][5][5];
|
||||
@@ -0,0 +1 @@
|
||||
val sss = Array(5, { Array<Array<String>>(5, { arrayOfNulls<String>(5) }) })
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
long[] a = new long[]{1, 2, 3}
|
||||
@@ -0,0 +1 @@
|
||||
val a = longArray(1, 2, 3)
|
||||
@@ -0,0 +1,2 @@
|
||||
//method
|
||||
void fromArrayToCollection(Foo[] a) {}
|
||||
@@ -0,0 +1,2 @@
|
||||
fun fromArrayToCollection(a: Array<Foo>) {
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
int[] a = new int[]{1, 2, 3}
|
||||
@@ -0,0 +1 @@
|
||||
val a = intArray(1, 2, 3)
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
String[] a = new String[]{"abc"}
|
||||
@@ -0,0 +1 @@
|
||||
val a = array("abc")
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
assert boolMethod();
|
||||
@@ -0,0 +1 @@
|
||||
assert(boolMethod())
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
assert(boolMethod());
|
||||
@@ -0,0 +1 @@
|
||||
assert((boolMethod()))
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
assert true : "string details";
|
||||
@@ -0,0 +1 @@
|
||||
assert(true, "string details")
|
||||
@@ -0,0 +1,2 @@
|
||||
//statement
|
||||
assert true : "string details:" + x;
|
||||
@@ -0,0 +1 @@
|
||||
assert(true) { "string details:" + x }
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x &= 2
|
||||
@@ -0,0 +1 @@
|
||||
x = x and 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x = 2
|
||||
@@ -0,0 +1 @@
|
||||
x = 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x /= 2
|
||||
@@ -0,0 +1 @@
|
||||
x /= 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x -= 2
|
||||
@@ -0,0 +1 @@
|
||||
x -= 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x *= 2
|
||||
@@ -0,0 +1 @@
|
||||
x *= 2
|
||||
@@ -0,0 +1,11 @@
|
||||
// !forceNotNullTypes: false
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
import java.util.HashSet;
|
||||
|
||||
class Foo {
|
||||
void foo(HashSet o) {
|
||||
HashSet o2 = o;
|
||||
int foo = 0;
|
||||
foo = o2.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// !forceNotNullTypes: false
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
import java.util.HashSet
|
||||
|
||||
class Foo {
|
||||
fun foo(o: HashSet<Any?>?) {
|
||||
val o2: HashSet<Any?>? = o
|
||||
var foo: Int = 0
|
||||
foo = o2!!.size()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.HashSet;
|
||||
|
||||
class Foo {
|
||||
void foo(HashSet o) {
|
||||
HashSet o2 = o;
|
||||
int foo = 0;
|
||||
foo = o2.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.HashSet
|
||||
|
||||
class Foo {
|
||||
fun foo(o: HashSet<Any>) {
|
||||
val o2 = o
|
||||
var foo = 0
|
||||
foo = o2.size()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x |= 2
|
||||
@@ -0,0 +1 @@
|
||||
x = x or 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x += 2
|
||||
@@ -0,0 +1 @@
|
||||
x += 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x %= 2
|
||||
@@ -0,0 +1 @@
|
||||
x %= 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x <<= 2
|
||||
@@ -0,0 +1 @@
|
||||
x = x shl 2
|
||||
@@ -0,0 +1,2 @@
|
||||
//expression
|
||||
x >>= 2
|
||||
@@ -0,0 +1 @@
|
||||
x = x shr 2
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user