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/") {
testClass<AbstractNullabilityAnalysisTest> {
model("fileOrElement")
model("nullabilityAnalyzer")
}
}
@@ -1,3 +1,2 @@
//statement
String x = "nya"
assert true : "string details:" + x;
@@ -1,2 +1 @@
val x = "nya"
assert(true) { "string details:$x" }
@@ -1,3 +1,2 @@
//statement
int x = 0;
x &= 2
@@ -1,2 +1 @@
var x = 0
x = x and 2
@@ -1,3 +1,2 @@
//statement
int x = 0;
x |= 2
-1
View File
@@ -1,2 +1 @@
var x = 0
x = x or 2
@@ -1,3 +1,2 @@
//statement
int x = 0;
x <<= 2
@@ -1,2 +1 @@
var x = 0
x = x shl 2
@@ -1,3 +1,2 @@
//statement
int x = 0;
x >>= 2
@@ -1,2 +1 @@
var x = 0
x = x shr 2
@@ -1,3 +1,2 @@
//statement
int x = 0;
x >>>= 2
@@ -1,2 +1 @@
var x = 0
x = x ushr 2
@@ -1,3 +1,2 @@
//statement
int x = 0;
x ^= 2
@@ -1,2 +1 @@
var x = 0
x = x xor 2
+2 -3
View File
@@ -1,3 +1,2 @@
//statement
int x = 2;
x & 2;
//expression
x & 2
-1
View File
@@ -1,2 +1 @@
val x = 2
x and 2
+2 -3
View File
@@ -1,3 +1,2 @@
//statement
int x = 0;
x | 2;
//expression
x | 2
-1
View File
@@ -1,2 +1 @@
val x = 0
x or 2
+2 -3
View File
@@ -1,3 +1,2 @@
//statement
int x = 0;
x << 2;
//expression
x << 2
@@ -1,2 +1 @@
val x = 0
x shl 2
@@ -1,3 +1,2 @@
//statement
int x = 0;
x >> 2;
//expression
x >> 2
@@ -1,2 +1 @@
val x = 0
x shr 2
@@ -1,3 +1,2 @@
//statement
int x = 0;
x >>> 2;
//expression
x >>> 2
@@ -1,2 +1 @@
val x = 0
x.ushr(2)
+2 -3
View File
@@ -1,3 +1,2 @@
//statement
int x = 0;
x ^ 2;
//expression
x ^ 2
-1
View File
@@ -1,2 +1 @@
val x = 0
x xor 2
-1
View File
@@ -1,5 +1,4 @@
//method
void bar(int a) {}
void foo() {
{
int a = 1;
-1
View File
@@ -1,4 +1,3 @@
fun bar(a: Int) {}
fun foo() {
run {
val a = 1
+1 -1
View File
@@ -1,2 +1,2 @@
//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() {
@Override
public void onChange(int visibility) {
int a = (visibility & 1)
val a = (visibility & 1)
}
}
}
@@ -1,3 +1,2 @@
interface I {}
class Base {}
final class A extends Base implements I {}
//class
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 {}
interface I0 {}
interface I1 {}
interface I2 {}
//class
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
+1 -1
View File
@@ -1,2 +1,2 @@
class Base {}
//class
final class A extends Base {}
-1
View File
@@ -1,2 +1 @@
internal open class Base
internal class A : Base()
@@ -12,7 +12,6 @@ internal class Customer(val firstName: String, val lastName: String) {
}
internal class CustomerBuilder {
var _firstName = "Homer"
var _firstName = "Homer"
var _lastName = "Simpson"
@@ -1,4 +1,2 @@
//statement
int a = 0;
int b = 0;
do {int i = 1; i = i + 1;} while (a > b)
@@ -1,5 +1,3 @@
val a = 0
val b = 0
do {
var i = 1
i = i + 1
@@ -1,3 +1,2 @@
//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)
@@ -1,12 +1,12 @@
/**
* This is a deprecated class.
* @deprecated This class is deprecated
*/
@Deprecated
class TestDeprecated {
/**
* This is a deprecated class.
* @deprecated This class is deprecated
* @deprecated This method is deprecated
*/
@Deprecated
class TestDeprecated {
/**
* @deprecated This method is deprecated
*/
@Deprecated
public void deprecatedMethod() {}
}
public void deprecatedMethod() {}
}
+1 -1
View File
@@ -13,4 +13,4 @@ enum class E private constructor(private val p: Int) {
internal fun foo(p: Int) {}
internal abstract fun bar()
}
}
-4
View File
@@ -1,7 +1,3 @@
class Foo {
Foo(int a, int b) {}
}
class C {
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 {
val f = Foo(1, 2)
}
-4
View File
@@ -1,7 +1,3 @@
class Foo {
Foo(int a, int b) {}
}
class C {
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 {
var f = Foo(1, 2)
}
@@ -1,3 +1,2 @@
//statement
int j = 0;
for (int i = 0; i < 0; j++, i++) {int i = 1; i++;}
@@ -1,4 +1,3 @@
var j = 0
var i = 0
while (i < 0) {
run {
-1
View File
@@ -1,3 +1,2 @@
//statement
int j = 0;
for (int i = 0; i < 0; j++, i++) {}
-1
View File
@@ -1,4 +1,3 @@
var j = 0
var i = 0
while (i < 0) {
j++
-1
View File
@@ -1,3 +1,2 @@
//statement
int t = 0;
for (int i = 0; i < 0; i++) t++;
-1
View File
@@ -1,2 +1 @@
var t = 0
for (i in 0..-1) t++
-1
View File
@@ -1,3 +1,2 @@
//statement
int j = 0;
for (int i = 0; i < 0; j++, i++) return i;
-1
View File
@@ -1,4 +1,3 @@
var j = 0
var i = 0
while (i < 0) {
return i
-3
View File
@@ -1,7 +1,4 @@
//method
boolean stop() {
return false;
}
void foo() {
for(;;) {
if (!stop()) break;
-4
View File
@@ -1,7 +1,3 @@
fun stop(): Boolean {
return false
}
fun foo() {
while (true) {
if (!stop()) break
@@ -1,3 +1,2 @@
//statement
int i = 0;
for (Node n : list) i++;
@@ -1,2 +1 @@
var i = 0
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.*;
class FileRead {
public static void main(String args[]) {
@@ -1,9 +1,10 @@
//file
import kotlinApi.KotlinClass;
class C {
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) {}
}
@@ -1,9 +1,2 @@
//class
class Foo {
Foo(int a, int b) {
}
void foo() {
Foo f = new Foo(1, 2);
}
}
//expression
new Foo(param);
@@ -1,6 +1 @@
internal class Foo(a: Int, b: Int) {
fun foo() {
val f = Foo(1, 2)
}
}
Foo(param)
@@ -1,9 +1,2 @@
//class
class Foo {
Foo(int a, int b) {
}
void foo() {
Foo f = new Foo(1, 2);
}
}
//expression
new Foo(param1, param2);
@@ -1,6 +1 @@
internal class Foo(a: Int, b: Int) {
fun foo() {
val f = Foo(1, 2)
}
}
Foo(param1, param2)
@@ -1,7 +1,2 @@
//class
class Foo {}
class Bar {
void bar() {
new Foo()
}
}
//expression
new Foo();
@@ -1,6 +1 @@
internal class Foo
internal class Bar {
fun bar() {
Foo()
}
}
Foo()
@@ -1,8 +1,5 @@
//method
// !specifyLocalVariableTypeByDefault: true
String bar() {
return null;
}
void foo() {
String s = bar();
if (s != null) {
@@ -1,7 +1,4 @@
// !specifyLocalVariableTypeByDefault: true
fun bar(): String? {
return null
}
fun foo() {
val s: String? = bar()
if (s != null) {
@@ -1,3 +1,2 @@
//statement
Character str = ''
(str.toString() + "abc").length()
//expression
(str.toString() + "abc").foo()
@@ -1,2 +1 @@
val str = ''
(str.toString() + "abc").length
(str.toString() + "abc").foo()
@@ -1,3 +1,2 @@
//statement
int i = 0
i--;
@@ -1,2 +1 @@
var i = 0
i--
@@ -1,3 +1,2 @@
//statement
int i = 0
i++;
@@ -1,2 +1 @@
var i = 0
i++
@@ -1,3 +1,2 @@
//statement
int i = 0;
--i;
@@ -1,2 +1 @@
var i = 0
--i
@@ -1,3 +1,2 @@
//statement
int i = 0;
++i;
@@ -1,2 +1 @@
var i = 0
++i
+12 -12
View File
@@ -1,16 +1,16 @@
//file
public class C {
public static void main(String[] args) {
switch (args.length) {
case 1: {
int a = 1;
System.out.print("1");
}
public class C {
public static void main(String[] args) {
switch (args.length) {
case 1: {
int a = 1;
System.out.print("1");
}
case 2: {
int a = 2;
System.out.print("2");
}
case 2: {
int a = 2;
System.out.print("2");
}
}
}
}
}
@@ -1,5 +1,2 @@
//class
interface I0 {}
interface I1 {}
interface 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
+1 -1
View File
@@ -1,2 +1,2 @@
interface I {}
//class
interface A extends I {}
@@ -1,2 +1 @@
internal interface I
internal interface A : I
+1 -1
View File
@@ -1,2 +1,2 @@
//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 {
val IN = "in"
val AT = "@"
val COMMA_WITH_SPACE = IN + AT
val COMMA_WITH_SPACE = COMMA + SPACE
}
}
@@ -1,2 +1,2 @@
//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 {
val IN = "in"
val AT = "@"
val COMMA_WITH_SPACE = IN + AT
val COMMA_WITH_SPACE = COMMA + SPACE
}
}
@@ -1,2 +1,2 @@
//statement
Object o = (Object) null
//expression
(Object) null
@@ -1 +1 @@
val o = null as Any?
null as Any?
@@ -1,4 +1,2 @@
interface INode {}
interface Node {}
class A {}
final class CC <T extends INode & Comparable<? super T>, K extends Node & Collection<? extends K>> extends A {}
//class
final class CC <T extends INode & Comparable<? super T>, K extends Node & Collection<? super K>> extends A {}
@@ -1,4 +1 @@
internal interface INode
internal interface Node
internal open class A
internal class CC<T : INode, K : Node> : A() where T : Comparable<T>, K : Collection<K>
internal class CC<T : INode, K : Node> : A() where T : Comparable<T>, K : Collection<in K>
@@ -1,2 +1,2 @@
interface INode {}
//class
final class C<T extends INode & Comparable<? super T>> {}
@@ -1,2 +1 @@
internal interface INode
internal class C<T : INode> where T : Comparable<T>
@@ -1,4 +1,2 @@
interface INode {}
class A {}
//class
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>

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