+= tests fix
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
fun box() : String {
|
||||
val map = java.util.TreeMap<String, String>()
|
||||
map["a"] = "1"
|
||||
map["b"] = "2"
|
||||
|
||||
var list = arrayList<String>()
|
||||
for (e in map) {
|
||||
list += e.getKey()
|
||||
}
|
||||
|
||||
return if(list.size==2) "OK" else "fail"
|
||||
}
|
||||
@@ -3,6 +3,5 @@ import java.util.ArrayList
|
||||
fun box(): String {
|
||||
var x: MutableCollection<Int> = ArrayList()
|
||||
x + ArrayList()
|
||||
x += ArrayList()
|
||||
return "OK"
|
||||
}
|
||||
|
||||
-5
@@ -1753,11 +1753,6 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/regressions/kt1568.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt1733.kt")
|
||||
public void testKt1733() throws Exception {
|
||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/regressions/kt1733.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt1770.kt")
|
||||
public void testKt1770() throws Exception {
|
||||
doTestWithStdlib("compiler/testData/codegen/boxWithStdlib/regressions/kt1770.kt");
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package foo
|
||||
|
||||
import java.util.*
|
||||
|
||||
fun <T> ArrayList<T>.plus(other: Collection<T>): List<T> {
|
||||
fun <T> ArrayList<T>.plus(other: Collection<T>): ArrayList<T> {
|
||||
val c = ArrayList<T>()
|
||||
c.addAll(this)
|
||||
c.addAll(other)
|
||||
|
||||
@@ -43,7 +43,7 @@ class FancyLines() {
|
||||
context.bezierCurveTo(width * Math.random(), height * Math.random(),
|
||||
width * Math.random(), height * Math.random(), x, y);
|
||||
|
||||
hue += Math.random() * 10;
|
||||
hue += (Math.random() * 10).toInt();
|
||||
|
||||
context.strokeStyle = "hsl($hue, 50%, 50%)";
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ class CollectionTest {
|
||||
assertEquals(arrayListOf("foo", "bar", "cheese"), list2)
|
||||
|
||||
// lets use a mutable variable
|
||||
var list3 = arrayListOf("a", "b")
|
||||
var list3 = listOf("a", "b")
|
||||
list3 += "c"
|
||||
assertEquals(arrayListOf("a", "b", "c"), list3)
|
||||
}
|
||||
@@ -216,7 +216,7 @@ class CollectionTest {
|
||||
assertEquals(arrayListOf("foo", "bar", "cheese", "wine"), list)
|
||||
|
||||
// lets use a mutable variable
|
||||
var ml = a
|
||||
var ml: List<String> = a
|
||||
ml += "beer"
|
||||
ml += b
|
||||
ml += "z"
|
||||
|
||||
@@ -44,7 +44,7 @@ class ListSpecificTest {
|
||||
Test fun mutableList() {
|
||||
val items = listOf("beverage", "location", "name")
|
||||
|
||||
var list = arrayListOf<String>()
|
||||
var list = listOf<String>()
|
||||
for (item in items) {
|
||||
list += item
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class DomTest {
|
||||
e.setAttribute("class", "bar")
|
||||
assertCssClass(e, "bar")
|
||||
|
||||
doc += e
|
||||
doc + e
|
||||
println("document ${doc.toXmlString()}")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user