1
0
forked from Mirror/wren
Files
wren/test/core/list/swap.wren
2020-12-03 13:17:53 -08:00

9 lines
219 B
Plaintext

var list = [0, 1, 2, 3, 4]
list.swap(0, 3)
System.print(list) // expect: [3, 1, 2, 0, 4]
list.swap(-1, 2)
System.print(list) // expect: [3, 1, 4, 0, 2]
list.swap(8, 0) // expect runtime error: Index 0 out of bounds.