New J2K: Split old j2k and new j2k tests

This commit is contained in:
Ilya Kirillov
2019-03-28 14:20:17 +03:00
committed by Ilya Kirillov
parent 02a206bf7c
commit b411e8e18e
1631 changed files with 14067 additions and 1513 deletions
@@ -967,15 +967,9 @@ fun main(args: Array<String>) {
} }
} }
testGroup("nj2k/tests", "j2k/testData") {
testClass<AbstractNewJavaToKotlinConverterSingleFileTest> {
model("fileOrElement", extension = "java")
}
}
testGroup("nj2k/tests", "nj2k/testData/") { testGroup("nj2k/tests", "nj2k/testData/") {
testClass<AbstractNullabilityAnalysisTest> { testClass<AbstractNullabilityAnalysisTest> {
model("fileOrElement") model("nullabilityAnalyzer")
} }
} }
@@ -1,3 +1,2 @@
//statement //statement
String x = "nya"
assert true : "string details:" + x; assert true : "string details:" + x;
@@ -1,2 +1 @@
val x = "nya"
assert(true) { "string details:$x" } assert(true) { "string details:$x" }
@@ -1,3 +1,2 @@
//statement //statement
int x = 0;
x &= 2 x &= 2
@@ -1,2 +1 @@
var x = 0
x = x and 2 x = x and 2
@@ -1,3 +1,2 @@
//statement //statement
int x = 0;
x |= 2 x |= 2
-1
View File
@@ -1,2 +1 @@
var x = 0
x = x or 2 x = x or 2
@@ -1,3 +1,2 @@
//statement //statement
int x = 0;
x <<= 2 x <<= 2
@@ -1,2 +1 @@
var x = 0
x = x shl 2 x = x shl 2
@@ -1,3 +1,2 @@
//statement //statement
int x = 0;
x >>= 2 x >>= 2
@@ -1,2 +1 @@
var x = 0
x = x shr 2 x = x shr 2
@@ -1,3 +1,2 @@
//statement //statement
int x = 0;
x >>>= 2 x >>>= 2
@@ -1,2 +1 @@
var x = 0
x = x ushr 2 x = x ushr 2
@@ -1,3 +1,2 @@
//statement //statement
int x = 0;
x ^= 2 x ^= 2
@@ -1,2 +1 @@
var x = 0
x = x xor 2 x = x xor 2
+2 -3
View File
@@ -1,3 +1,2 @@
//statement //expression
int x = 2; x & 2
x & 2;
-1
View File
@@ -1,2 +1 @@
val x = 2
x and 2 x and 2
+2 -3
View File
@@ -1,3 +1,2 @@
//statement //expression
int x = 0; x | 2
x | 2;
-1
View File
@@ -1,2 +1 @@
val x = 0
x or 2 x or 2
+2 -3
View File
@@ -1,3 +1,2 @@
//statement //expression
int x = 0; x << 2
x << 2;
@@ -1,2 +1 @@
val x = 0
x shl 2 x shl 2
@@ -1,3 +1,2 @@
//statement //expression
int x = 0; x >> 2
x >> 2;
@@ -1,2 +1 @@
val x = 0
x shr 2 x shr 2
@@ -1,3 +1,2 @@
//statement //expression
int x = 0; x >>> 2
x >>> 2;
@@ -1,2 +1 @@
val x = 0
x.ushr(2) x.ushr(2)
+2 -3
View File
@@ -1,3 +1,2 @@
//statement //expression
int x = 0; x ^ 2
x ^ 2;
-1
View File
@@ -1,2 +1 @@
val x = 0
x xor 2 x xor 2
-1
View File
@@ -1,5 +1,4 @@
//method //method
void bar(int a) {}
void foo() { void foo() {
{ {
int a = 1; int a = 1;
-1
View File
@@ -1,4 +1,3 @@
fun bar(a: Int) {}
fun foo() { fun foo() {
run { run {
val a = 1 val a = 1
+1 -1
View File
@@ -1,2 +1,2 @@
//statement //statement
Boolean i = false; Boolean i = 10;
+1 -1
View File
@@ -1 +1 @@
val i = false val i = 10
+1 -1
View File
@@ -6,7 +6,7 @@ public class Test {
private Listener listener = new Listener() { private Listener listener = new Listener() {
@Override @Override
public void onChange(int visibility) { public void onChange(int visibility) {
int a = (visibility & 1) val a = (visibility & 1)
} }
} }
} }
@@ -1,3 +1,2 @@
interface I {} //class
class Base {}
final class A extends Base implements I {} final class A extends Base implements I {}
@@ -1,3 +1 @@
internal interface I
internal open class Base
internal class A : Base(), I internal class A : Base(), I
@@ -1,5 +1,2 @@
class Base {} //class
interface I0 {}
interface I1 {}
interface I2 {}
final class A extends Base implements I0, I1, I2 {} final class A extends Base implements I0, I1, I2 {}
@@ -1,5 +1 @@
internal open class Base
internal interface I0
internal interface I1
internal interface I2
internal class A : Base(), I0, I1, I2 internal class A : Base(), I0, I1, I2
+1 -1
View File
@@ -1,2 +1,2 @@
class Base {} //class
final class A extends Base {} final class A extends Base {}
-1
View File
@@ -1,2 +1 @@
internal open class Base
internal class A : Base() internal class A : Base()
@@ -12,7 +12,6 @@ internal class Customer(val firstName: String, val lastName: String) {
} }
internal class CustomerBuilder { internal class CustomerBuilder {
var _firstName = "Homer"
var _firstName = "Homer" var _firstName = "Homer"
var _lastName = "Simpson" var _lastName = "Simpson"
@@ -1,4 +1,2 @@
//statement //statement
int a = 0;
int b = 0;
do {int i = 1; i = i + 1;} while (a > b) do {int i = 1; i = i + 1;} while (a > b)
@@ -1,5 +1,3 @@
val a = 0
val b = 0
do { do {
var i = 1 var i = 1
i = i + 1 i = i + 1
@@ -1,3 +1,2 @@
//statement //statement
int i = 0; do i = i + 1; while (true)
do i = i + 1; while (true);
@@ -1,2 +1 @@
var i = 0
do i = i + 1 while (true) do i = i + 1 while (true)
@@ -1,12 +1,12 @@
/**
* This is a deprecated class.
* @deprecated This class is deprecated
*/
@Deprecated
class TestDeprecated {
/** /**
* This is a deprecated class. * @deprecated This method is deprecated
* @deprecated This class is deprecated
*/ */
@Deprecated @Deprecated
class TestDeprecated { public void deprecatedMethod() {}
/** }
* @deprecated This method is deprecated
*/
@Deprecated
public void deprecatedMethod() {}
}
-4
View File
@@ -1,7 +1,3 @@
class Foo {
Foo(int a, int b) {}
}
class C { class C {
final Foo f = new Foo(1, 2); final Foo f = new Foo(1, 2);
} }
+1 -2
View File
@@ -1,5 +1,4 @@
internal class Foo(a: Int, b: Int) // ERROR: Unresolved reference: Foo
internal class C { internal class C {
val f = Foo(1, 2) val f = Foo(1, 2)
} }
-4
View File
@@ -1,7 +1,3 @@
class Foo {
Foo(int a, int b) {}
}
class C { class C {
Foo f = new Foo(1, 2); Foo f = new Foo(1, 2);
} }
+1 -2
View File
@@ -1,5 +1,4 @@
internal class Foo(a: Int, b: Int) // ERROR: Unresolved reference: Foo
internal class C { internal class C {
var f = Foo(1, 2) var f = Foo(1, 2)
} }
@@ -1,3 +1,2 @@
//statement //statement
int j = 0;
for (int i = 0; i < 0; j++, i++) {int i = 1; i++;} for (int i = 0; i < 0; j++, i++) {int i = 1; i++;}
@@ -1,4 +1,3 @@
var j = 0
var i = 0 var i = 0
while (i < 0) { while (i < 0) {
run { run {
-1
View File
@@ -1,3 +1,2 @@
//statement //statement
int j = 0;
for (int i = 0; i < 0; j++, i++) {} for (int i = 0; i < 0; j++, i++) {}
-1
View File
@@ -1,4 +1,3 @@
var j = 0
var i = 0 var i = 0
while (i < 0) { while (i < 0) {
j++ j++
-1
View File
@@ -1,3 +1,2 @@
//statement //statement
int t = 0;
for (int i = 0; i < 0; i++) t++; for (int i = 0; i < 0; i++) t++;
-1
View File
@@ -1,2 +1 @@
var t = 0
for (i in 0..-1) t++ for (i in 0..-1) t++
-1
View File
@@ -1,3 +1,2 @@
//statement //statement
int j = 0;
for (int i = 0; i < 0; j++, i++) return i; for (int i = 0; i < 0; j++, i++) return i;
-1
View File
@@ -1,4 +1,3 @@
var j = 0
var i = 0 var i = 0
while (i < 0) { while (i < 0) {
return i return i
-3
View File
@@ -1,7 +1,4 @@
//method //method
boolean stop() {
return false;
}
void foo() { void foo() {
for(;;) { for(;;) {
if (!stop()) break; if (!stop()) break;
-4
View File
@@ -1,7 +1,3 @@
fun stop(): Boolean {
return false
}
fun foo() { fun foo() {
while (true) { while (true) {
if (!stop()) break if (!stop()) break
@@ -1,3 +1,2 @@
//statement //statement
int i = 0;
for (Node n : list) i++; for (Node n : list) i++;
@@ -1,2 +1 @@
var i = 0
for (n in list) i++ for (n in list) i++
@@ -1,3 +0,0 @@
internal open class Base(name: String)
internal class One(name: String, private val mySecond: String) : Base(name)
-1
View File
@@ -1,5 +1,4 @@
import java.io.*; import java.io.*;
import java.io.*;
class FileRead { class FileRead {
public static void main(String args[]) { public static void main(String args[]) {
@@ -1,9 +1,10 @@
//file //file
import kotlinApi.KotlinClass; import kotlinApi.KotlinClass;
class C { class C {
int foo() { int foo() {
KotlinClass.Companion.getStaticVar() KotlinClass.staticVar = KotlinClass.staticVar * 2;
KotlinClass.Companion.setStaticProperty(KotlinClass.Companion.getStaticVar() + KotlinClass.Companion.getStaticProperty());
return KotlinClass.Companion.staticFun(1);
} }
} }
@@ -132,3 +132,4 @@ class A {
} }
void useSplit(String[] result) {} void useSplit(String[] result) {}
}
@@ -1,9 +1,2 @@
//class //expression
class Foo { new Foo(param);
Foo(int a, int b) {
}
void foo() {
Foo f = new Foo(1, 2);
}
}
@@ -1,6 +1 @@
internal class Foo(a: Int, b: Int) { Foo(param)
fun foo() {
val f = Foo(1, 2)
}
}
@@ -1,9 +1,2 @@
//class //expression
class Foo { new Foo(param1, param2);
Foo(int a, int b) {
}
void foo() {
Foo f = new Foo(1, 2);
}
}
@@ -1,6 +1 @@
internal class Foo(a: Int, b: Int) { Foo(param1, param2)
fun foo() {
val f = Foo(1, 2)
}
}
@@ -1,7 +1,2 @@
//class //expression
class Foo {} new Foo();
class Bar {
void bar() {
new Foo()
}
}
@@ -1,6 +1 @@
internal class Foo Foo()
internal class Bar {
fun bar() {
Foo()
}
}
@@ -1,8 +1,5 @@
//method //method
// !specifyLocalVariableTypeByDefault: true // !specifyLocalVariableTypeByDefault: true
String bar() {
return null;
}
void foo() { void foo() {
String s = bar(); String s = bar();
if (s != null) { if (s != null) {
@@ -1,7 +1,4 @@
// !specifyLocalVariableTypeByDefault: true // !specifyLocalVariableTypeByDefault: true
fun bar(): String? {
return null
}
fun foo() { fun foo() {
val s: String? = bar() val s: String? = bar()
if (s != null) { if (s != null) {
@@ -1,3 +1,2 @@
//statement //expression
Character str = '' (str.toString() + "abc").foo()
(str.toString() + "abc").length()
@@ -1,2 +1 @@
val str = '' (str.toString() + "abc").foo()
(str.toString() + "abc").length
@@ -1,3 +1,2 @@
//statement //statement
int i = 0
i--; i--;
@@ -1,2 +1 @@
var i = 0
i-- i--
@@ -1,3 +1,2 @@
//statement //statement
int i = 0
i++; i++;
@@ -1,2 +1 @@
var i = 0
i++ i++
@@ -1,3 +1,2 @@
//statement //statement
int i = 0;
--i; --i;
@@ -1,2 +1 @@
var i = 0
--i --i
@@ -1,3 +1,2 @@
//statement //statement
int i = 0;
++i; ++i;
@@ -1,2 +1 @@
var i = 0
++i ++i
+11 -11
View File
@@ -1,16 +1,16 @@
//file //file
public class C { public class C {
public static void main(String[] args) { public static void main(String[] args) {
switch (args.length) { switch (args.length) {
case 1: { case 1: {
int a = 1; int a = 1;
System.out.print("1"); System.out.print("1");
} }
case 2: { case 2: {
int a = 2; int a = 2;
System.out.print("2"); System.out.print("2");
}
} }
} }
} }
}
@@ -1,5 +1,2 @@
//class //class
interface I0 {}
interface I1 {}
interface I2 {}
interface A extends I0, I1, I2 {} interface A extends I0, I1, I2 {}
@@ -1,4 +1 @@
internal interface I0
internal interface I1
internal interface I2
internal interface A : I0, I1, I2 internal interface A : I0, I1, I2
+1 -1
View File
@@ -1,2 +1,2 @@
interface I {} //class
interface A extends I {} interface A extends I {}
@@ -1,2 +1 @@
internal interface I
internal interface A : I internal interface A : I
+1 -1
View File
@@ -1,2 +1,2 @@
//class //class
interface INode {String IN = "in";String AT = "@";String COMMA_WITH_SPACE = IN + AT;} interface INode {String IN = "in";String AT = "@";String COMMA_WITH_SPACE = COMMA + SPACE;}
+1 -1
View File
@@ -2,6 +2,6 @@ internal interface INode {
companion object { companion object {
val IN = "in" val IN = "in"
val AT = "@" val AT = "@"
val COMMA_WITH_SPACE = IN + AT val COMMA_WITH_SPACE = COMMA + SPACE
} }
} }
@@ -1,2 +1,2 @@
//class //class
public interface INode { public static final String IN = "in"; public static final String AT = "@"; public static final String COMMA_WITH_SPACE = IN + AT;} public interface INode { public static final String IN = "in"; public static final String AT = "@"; public static final String COMMA_WITH_SPACE = COMMA + SPACE;}
@@ -2,6 +2,6 @@ interface INode {
companion object { companion object {
val IN = "in" val IN = "in"
val AT = "@" val AT = "@"
val COMMA_WITH_SPACE = IN + AT val COMMA_WITH_SPACE = COMMA + SPACE
} }
} }
@@ -1,2 +1,2 @@
//statement //expression
Object o = (Object) null (Object) null
@@ -1 +1 @@
val o = null as Any? null as Any?
@@ -1,4 +1,2 @@
interface INode {} //class
interface Node {} final class CC <T extends INode & Comparable<? super T>, K extends Node & Collection<? super K>> extends A {}
class A {}
final class CC <T extends INode & Comparable<? super T>, K extends Node & Collection<? extends K>> extends A {}
@@ -1,4 +1 @@
internal interface INode internal class CC<T : INode, K : Node> : A() where T : Comparable<T>, K : Collection<in K>
internal interface Node
internal open class A
internal class CC<T : INode, K : Node> : A() where T : Comparable<T>, K : Collection<K>
@@ -1,2 +1,2 @@
interface INode {} //class
final class C<T extends INode & Comparable<? super T>> {} final class C<T extends INode & Comparable<? super T>> {}
@@ -1,2 +1 @@
internal interface INode
internal class C<T : INode> where T : Comparable<T> internal class C<T : INode> where T : Comparable<T>
@@ -1,4 +1,2 @@
interface INode {} //class
class A {}
final class C<T extends INode & Comparable<? super T>> extends A {} final class C<T extends INode & Comparable<? super T>> extends A {}
@@ -1,4 +1 @@
internal interface INode
internal open class A
internal class C<T : INode> : A() where T : Comparable<T> internal class C<T : INode> : A() where T : Comparable<T>
@@ -1,5 +1,2 @@
interface INode {} //class
interface Node {} interface I <T extends INode & Comparable<? super T>, K extends Node & Collection<? super K>> extends II {}
interface II {}
interface I <T extends INode & Comparable<? super T>, K extends Node & Collection<? extends K>> extends II {}

Some files were not shown because too many files have changed in this diff Show More