diff --git a/backend.native/tests/runtime/collections/array_list1.kt b/backend.native/tests/runtime/collections/array_list1.kt index b05582121a3..3c064afbfe0 100644 --- a/backend.native/tests/runtime/collections/array_list1.kt +++ b/backend.native/tests/runtime/collections/array_list1.kt @@ -259,27 +259,22 @@ fun testSubListLastIndexOf() { fun testIteratorRemove() { val a = makeList12345() val it = a.iterator() - var i = 1 - while (it.hasNext()) { - if (i++ % 2 == 0) { + while (it.hasNext()) + if (it.next()[0].toInt() % 2 == 0) it.remove() - } - it.next() - } - assertEquals(makeList135(), a) } fun testIteratorAdd() { val a = makeList12345() val it = a.listIterator() - var i = 0 + var i = 1 while (it.hasNext()) { val next = it.next() if (i++ % 2 == 0) it.add("-" + next) } - //assertEquals(listOf("1", "2", "-2", "3", "4", "-4", "5"), a) + assertEquals("[1, 2, -2, 3, 4, -4, 5]", a.toString()) } @@ -299,7 +294,7 @@ fun main(args : Array) { testSubListContains() testSubListIndexOf() testSubListLastIndexOf() -// testIteratorAdd() runtime assert: Throwing is unsupported -// testIteratorRemove() assertEquals fails + testIteratorAdd() + testIteratorRemove() println("OK") } \ No newline at end of file