1
0
forked from Mirror/wren
Files
wren/test/list/subscript_setter.wren
Bob Nystrom 59bb7eec7a Remove some outdated TODOs.
They’re TODONE!
2014-02-13 08:38:44 -08:00

26 lines
425 B
Plaintext

// Basic assignment.
{
var list = [1, 2, 3]
list[0] = 5
list[1] = 6
list[2] = 7
IO.print(list) // expect: [5, 6, 7]
}
// Returns right-hand side.
{
var list = [1, 2, 3]
IO.print(list[1] = 5) // expect: 5
}
// Negative indices.
{
var list = [1, 2, 3]
list[-1] = 5
list[-2] = 6
list[-3] = 7
IO.print(list) // expect: [7, 6, 5]
}
// TODO: Not in this dir, but need tests for subscript setter grammar.