mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Allow [0..-1] and [0...0] to work on empty lists.
This commit is contained in:
@ -29,3 +29,7 @@ IO.print(list[1..-2]) // expect: [b, c, d]
|
||||
IO.print(list[2...-1]) // expect: [c, d]
|
||||
IO.print(list[4..-5]) // expect: [e, d, c, b, a]
|
||||
IO.print(list[3...-6]) // expect: [d, c, b, a]
|
||||
|
||||
// An empty range at zero is allowed on an empty list.
|
||||
IO.print([][0...0]) // expect: []
|
||||
IO.print([][0..-1]) // expect: []
|
||||
|
||||
Reference in New Issue
Block a user