mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
Fix shrinking list capacity.
This commit is contained in:
11
test/list/grow_shrink.wren
Normal file
11
test/list/grow_shrink.wren
Normal file
@ -0,0 +1,11 @@
|
||||
// This mostly tests that lists handle growing and shrinking their memory.
|
||||
var list = []
|
||||
for (i in 0..200) {
|
||||
list.add(i)
|
||||
}
|
||||
|
||||
for (i in 0..195) {
|
||||
list.removeAt(-1)
|
||||
}
|
||||
|
||||
IO.print(list) // expect: [0, 1, 2, 3, 4]
|
||||
Reference in New Issue
Block a user