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