Migrate boxWithJava tests to multi-file framework

This commit is contained in:
Alexander Udalov
2016-03-01 19:18:37 +03:00
parent 0801ae5364
commit 2de7f38427
266 changed files with 2271 additions and 1729 deletions

View File

@@ -1,3 +1,5 @@
// FILE: Test.java
import java.lang.*;
import java.util.*;
@@ -8,3 +10,19 @@ public class Test {
public String setValue(String s) { return null; }
}
}
// FILE: main.kt
//class MyIterable : Test.IterableImpl()
//class MyIterator : Test.IteratorImpl()
class MyMapEntry : Test.MapEntryImpl()
fun box(): String {
val b = MyMapEntry()
b.key
b.value
b.setValue(null)
return "OK"
}

View File

@@ -1,13 +0,0 @@
//class MyIterable : Test.IterableImpl()
//class MyIterator : Test.IteratorImpl()
class MyMapEntry : Test.MapEntryImpl()
fun box(): String {
val b = MyMapEntry()
b.key
b.value
b.setValue(null)
return "OK"
}

View File

@@ -1,3 +1,16 @@
// FILE: Test.java
public class Test {
public static void checkCallFromJava() {
try {
String x = TestKt.foo().iterator().next();
throw new AssertionError("E should have been thrown");
} catch (E e) { }
}
}
// FILE: test.kt
interface MyIterable<T> : Iterable<T>
class E : RuntimeException()

View File

@@ -1,8 +0,0 @@
public class Test {
public static void checkCallFromJava() {
try {
String x = SubstitutedIterableKt.foo().iterator().next();
throw new AssertionError("E should have been thrown");
} catch (E e) { }
}
}

View File

@@ -1,3 +1,20 @@
// FILE: Test.java
class Test {
interface A {
boolean add(String s);
}
static class D extends C {}
void test() {
A a = new D();
a.add("lol");
}
}
// FILE: test.kt
abstract class C : Test.A, List<String> {
override val size: Int get() = null!!
override fun isEmpty(): Boolean = null!!

View File

@@ -1,12 +0,0 @@
class Test {
interface A {
boolean add(String s);
}
static class D extends C {}
void test() {
A a = new D();
a.add("lol");
}
}