Refactored tests using Array constructor:
Some moved to tests with stdlib Some changed to use arrayOfNulls
This commit is contained in:
committed by
Alexander Udalov
parent
abbcf61183
commit
654411a0b0
@@ -1,11 +1,11 @@
|
||||
fun box() : String {
|
||||
val a = Array<Int> (5, {0})
|
||||
val a = arrayOfNulls<Int>(5)
|
||||
var i = 0
|
||||
var sum = 0
|
||||
for(el in 0..4) {
|
||||
a[i] = i++
|
||||
}
|
||||
for (el in a) {
|
||||
for (el in (a as Array<Int>)) {
|
||||
sum = sum + el
|
||||
}
|
||||
if(sum != 10) return "a failed"
|
||||
|
||||
Reference in New Issue
Block a user