Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
This commit is contained in:
committed by
Alexander Udalov
parent
54a615fcd3
commit
20e36438e2
@@ -0,0 +1,25 @@
|
||||
import java.util.HashMap
|
||||
|
||||
fun box() : String {
|
||||
if (!testIteratingOverMap1()) return "fail 1"
|
||||
if (!testIteratingOverMap2()) return "fail 2"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun testIteratingOverMap1() : Boolean {
|
||||
val map = HashMap<String, Int>()
|
||||
map.put("a", 1)
|
||||
for (entry in map.entries) {
|
||||
entry.setValue(2)
|
||||
}
|
||||
return map.get("a") == 2
|
||||
}
|
||||
|
||||
fun testIteratingOverMap2() : Boolean {
|
||||
val map : MutableMap<String, Int> = HashMap<String, Int>()
|
||||
map.put("a", 1)
|
||||
for (entry in map.entries) {
|
||||
entry.setValue(2)
|
||||
}
|
||||
return map.get("a") == 2
|
||||
}
|
||||
Reference in New Issue
Block a user