Fix deprecations in js and java tests.

This commit is contained in:
Ilya Gorbunov
2015-09-16 16:51:23 +03:00
parent 7f7cc02256
commit 439d1026bf
2 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -56,12 +56,12 @@ class RegExpTest {
val string = "R2D2 beats A5D5 "
var re = RegExp("""(\w\d)(\w\d)""", "g")
val m1 = re.exec(string)!!
assertEquals(array("R2D2", "R2", "D2"), m1)
assertEquals(arrayOf("R2D2", "R2", "D2"), m1)
assertEquals(0, (m1 as RegExpMatch).index)
assertEquals(4, re.lastIndex)
val m2 = re.exec(string)!!
assertEquals(array("A5D5", "A5", "D5"), m2)
assertEquals(arrayOf("A5D5", "A5", "D5"), m2)
assertEquals(string.indexOf(m2[0]!!), (m2 as RegExpMatch).index)
val noMatch = re.exec(string)
@@ -7,7 +7,6 @@ import java.util.Collection;
import java.util.List;
import static kotlin.KotlinPackage.*;
import static kotlin.util.UtilPackage.*;
/**
* Lets try using the Kotlin standard library from Java code
@@ -15,9 +14,9 @@ import static kotlin.util.UtilPackage.*;
public class CollectionTest extends TestCase {
public void testCollections() throws Exception {
List<String> list = arrayList("foo", "bar");
List<String> list = arrayListOf("foo", "bar");
String text = makeString(list, ",", "(", ")", -1, "...");
String text = joinToString(list, ",", "(", ")", -1, "...", null);
System.out.println("Have text: " + text);
assertEquals("(foo,bar)", text);
@@ -29,6 +28,6 @@ public class CollectionTest extends TestCase {
});
System.out.println("Filtered list is " + actual);
assertEquals("(bar)", makeString(actual, ",", "(", ")", -1, "..."));
assertEquals("(bar)", joinToString(actual, ",", "(", ")", -1, "...", null));
}
}