added test cases for KT-1619 and KT-1617

This commit is contained in:
James Strachan
2012-03-20 12:03:25 +00:00
parent dcfeb4bc2c
commit 5bcef67dfe
2 changed files with 38 additions and 0 deletions
@@ -0,0 +1,20 @@
package regressions
// TODO comment out the next line to reproduce KT-1617
import kotlin.util.map
import kotlin.util.arrayList
import java.util.Collection
import java.io.File
import junit.framework.TestCase
class Kt1617Test: TestCase() {
fun testMapFunction() {
val coll: Collection<String> = arrayList("foo", "bar")
val files = coll.map<String, File>{ File(it) }
println("Found files: $files")
}
}
@@ -0,0 +1,18 @@
package regressions
import junit.framework.TestCase
import java.util.List
import kotlin.util.arrayList
class Kt1619Test: TestCase() {
fun doSomething(list: List<String?>): Boolean {
return list.size() > 0
}
fun testCollectionNotNullCanBeUsedForNullables() {
val list: List<String> = arrayList("foo", "bar")
// TODO uncomment this line to reproduce KT-1619
// doSomething(list)
}
}