2014-01-20 08:45:15 -08:00
|
|
|
// Ordered range.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print((2..5).to) // expect: 5
|
|
|
|
|
System.print((3..3).to) // expect: 3
|
|
|
|
|
System.print((0..3).to) // expect: 3
|
|
|
|
|
System.print((-5..3).to) // expect: 3
|
|
|
|
|
System.print((-5..-2).to) // expect: -2
|
2014-01-20 08:45:15 -08:00
|
|
|
|
|
|
|
|
// Backwards range.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print((5..2).to) // expect: 2
|
|
|
|
|
System.print((3..0).to) // expect: 0
|
|
|
|
|
System.print((3..-5).to) // expect: -5
|
|
|
|
|
System.print((-2..-5).to) // expect: -5
|
2014-01-20 08:45:15 -08:00
|
|
|
|
|
|
|
|
// Exclusive ordered range.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print((2...5).to) // expect: 5
|
|
|
|
|
System.print((3...3).to) // expect: 3
|
|
|
|
|
System.print((0...3).to) // expect: 3
|
|
|
|
|
System.print((-5...3).to) // expect: 3
|
|
|
|
|
System.print((-5...-2).to) // expect: -2
|
2014-01-20 08:45:15 -08:00
|
|
|
|
|
|
|
|
// Exclusive backwards range.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print((5...2).to) // expect: 2
|
|
|
|
|
System.print((3...0).to) // expect: 0
|
|
|
|
|
System.print((3...-5).to) // expect: -5
|
|
|
|
|
System.print((-2...-5).to) // expect: -5
|