Migrate boxAgainstJava tests to multi-file framework
This commit is contained in:
-40
@@ -1,40 +0,0 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class Container {
|
||||
@NotNull
|
||||
Value get(Runnable i) {
|
||||
i.run();
|
||||
return new Value();
|
||||
}
|
||||
|
||||
void set(Runnable i, @NotNull Value value) {
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
|
||||
class Value {
|
||||
@NotNull Value plus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value minus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value times(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value div(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value mod(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+65
-22
@@ -1,30 +1,73 @@
|
||||
// FILE: Container.java
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class Container {
|
||||
@NotNull
|
||||
Value get(Runnable i) {
|
||||
i.run();
|
||||
return new Value();
|
||||
}
|
||||
|
||||
void set(Runnable i, @NotNull Value value) {
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
|
||||
class Value {
|
||||
@NotNull Value plus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value minus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value times(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value div(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull Value mod(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
var c = Container()
|
||||
var indexAccess = 0
|
||||
|
||||
// TODO uncomment when KT-3723 is fixed
|
||||
var v1 = "FAIL"
|
||||
c[{ indexAccess++ }] += { v1 = "OK" }
|
||||
if (v1 != "OK") return "plus: $v1"
|
||||
|
||||
//var v1 = "FAIL"
|
||||
//c[{ indexAccess++ }] += { v1 = "OK" }
|
||||
//if (v1 != "OK") return "plus: $v1"
|
||||
//
|
||||
//var v2 = "FAIL"
|
||||
//c[{ indexAccess++ }] -= { v2 = "OK" }
|
||||
//if (v2 != "OK") return "minus: $v2"
|
||||
//
|
||||
//var v3 = "FAIL"
|
||||
//c[{ indexAccess++ }] *= { v3 = "OK" }
|
||||
//if (v3 != "OK") return "times: $v3"
|
||||
//
|
||||
//var v4 = "FAIL"
|
||||
//c[{ indexAccess++ }] /= { v4 = "OK" }
|
||||
//if (v4 != "OK") return "div: $v4"
|
||||
//
|
||||
//var v5 = "FAIL"
|
||||
//c[{ indexAccess++ }] %= { v5 = "OK" }
|
||||
//if (v5 != "OK") return "mod: $v5"
|
||||
//
|
||||
//if (indexAccess != 10) return indexAccess
|
||||
var v2 = "FAIL"
|
||||
c[{ indexAccess++ }] -= { v2 = "OK" }
|
||||
if (v2 != "OK") return "minus: $v2"
|
||||
|
||||
var v3 = "FAIL"
|
||||
c[{ indexAccess++ }] *= { v3 = "OK" }
|
||||
if (v3 != "OK") return "times: $v3"
|
||||
|
||||
var v4 = "FAIL"
|
||||
c[{ indexAccess++ }] /= { v4 = "OK" }
|
||||
if (v4 != "OK") return "div: $v4"
|
||||
|
||||
var v5 = "FAIL"
|
||||
c[{ indexAccess++ }] %= { v5 = "OK" }
|
||||
if (v5 != "OK") return "mod: $v5"
|
||||
|
||||
if (indexAccess != 10) return "Fail: $indexAccess"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
class JavaClass {
|
||||
void plusAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void minusAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void timesAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void divAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void modAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
+26
@@ -1,3 +1,29 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
void plusAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void minusAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void timesAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void divAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
|
||||
void modAssign(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class JavaClass {
|
||||
@NotNull JavaClass plus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass minus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass times(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass div(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass mod(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
+33
@@ -1,3 +1,36 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class JavaClass {
|
||||
@NotNull JavaClass plus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass minus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass times(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass div(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull JavaClass mod(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
var obj = JavaClass()
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
class JavaClass {
|
||||
JavaClass plus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass minus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass times(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass div(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass mod(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass rangeTo(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,39 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
JavaClass plus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass minus(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass times(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass div(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass mod(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
|
||||
JavaClass rangeTo(Runnable i) {
|
||||
i.run();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
class JavaClass {
|
||||
int compareTo(Runnable i) {
|
||||
i.run();
|
||||
return 239;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,14 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
int compareTo(Runnable i) {
|
||||
i.run();
|
||||
return 239;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
class JavaClass {
|
||||
boolean contains(Runnable i) {
|
||||
i.run();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,14 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
boolean contains(Runnable i) {
|
||||
i.run();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
class JavaClass {
|
||||
int get(Runnable i) {
|
||||
i.run();
|
||||
return 239;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,14 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
int get(Runnable i) {
|
||||
i.run();
|
||||
return 239;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
class JavaClass {
|
||||
void invoke(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,13 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
void invoke(Runnable i) {
|
||||
i.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
class JavaClass {
|
||||
int get(Runnable i1, Runnable i2) {
|
||||
i1.run();
|
||||
i2.run();
|
||||
return 239;
|
||||
}
|
||||
|
||||
void set(Runnable i1, Runnable i2, Runnable value) {
|
||||
i1.run();
|
||||
i2.run();
|
||||
value.run();
|
||||
}
|
||||
}
|
||||
+18
@@ -1,3 +1,21 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
int get(Runnable i1, Runnable i2) {
|
||||
i1.run();
|
||||
i2.run();
|
||||
return 239;
|
||||
}
|
||||
|
||||
void set(Runnable i1, Runnable i2, Runnable value) {
|
||||
i1.run();
|
||||
i2.run();
|
||||
value.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
class JavaClass {
|
||||
void invoke(Runnable p1, Runnable p2) {
|
||||
p1.run();
|
||||
p2.run();
|
||||
}
|
||||
}
|
||||
+11
@@ -1,3 +1,14 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
void invoke(Runnable p1, Runnable p2) {
|
||||
p1.run();
|
||||
p2.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
class JavaClass {
|
||||
void set(Runnable i, Runnable value) {
|
||||
i.run();
|
||||
value.run();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,14 @@
|
||||
// FILE: JavaClass.java
|
||||
|
||||
class JavaClass {
|
||||
void set(Runnable i, Runnable value) {
|
||||
i.run();
|
||||
value.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
fun box(): String {
|
||||
val obj = JavaClass()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user