Fix #2. Finish implementing Range.

Covers error and edge cases and fully tested now.
This commit is contained in:
Bob Nystrom
2014-01-20 13:20:22 -08:00
parent 97bf314f4b
commit 46c1ba9249
14 changed files with 148 additions and 38 deletions
+9 -9
View File
@@ -12,14 +12,14 @@ IO.print((3..-5).to) // expect: -5
IO.print((-2..-5).to) // expect: -5
// Exclusive ordered range.
IO.print((2...5).to) // expect: 4
IO.print((3...3).to) // expect: 2
IO.print((0...3).to) // expect: 2
IO.print((-5...3).to) // expect: 2
IO.print((-5...-2).to) // expect: -3
IO.print((2...5).to) // expect: 5
IO.print((3...3).to) // expect: 3
IO.print((0...3).to) // expect: 3
IO.print((-5...3).to) // expect: 3
IO.print((-5...-2).to) // expect: -2
// Exclusive backwards range.
IO.print((5...2).to) // expect: 1
IO.print((3...0).to) // expect: -1
IO.print((3...-5).to) // expect: -6
IO.print((-2...-5).to) // expect: -6
IO.print((5...2).to) // expect: 2
IO.print((3...0).to) // expect: 0
IO.print((3...-5).to) // expect: -5
IO.print((-2...-5).to) // expect: -5