2014-01-20 08:45:15 -08:00
|
|
|
// Ordered range.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print((2..5).max) // expect: 5
|
|
|
|
|
System.print((3..3).max) // expect: 3
|
|
|
|
|
System.print((0..3).max) // expect: 3
|
|
|
|
|
System.print((-5..3).max) // expect: 3
|
|
|
|
|
System.print((-5..-2).max) // expect: -2
|
2014-01-20 08:45:15 -08:00
|
|
|
|
|
|
|
|
// Backwards range.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print((5..2).max) // expect: 5
|
|
|
|
|
System.print((3..0).max) // expect: 3
|
|
|
|
|
System.print((3..-5).max) // expect: 3
|
|
|
|
|
System.print((-2..-5).max) // expect: -2
|
2014-01-20 08:45:15 -08:00
|
|
|
|
|
|
|
|
// Exclusive ordered range.
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print((2...5).max) // expect: 5
|
|
|
|
|
System.print((3...3).max) // expect: 3
|
|
|
|
|
System.print((0...3).max) // expect: 3
|
|
|
|
|
System.print((-5...3).max) // expect: 3
|
|
|
|
|
System.print((-5...-2).max) // 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).max) // expect: 5
|
|
|
|
|
System.print((3...0).max) // expect: 3
|
|
|
|
|
System.print((3...-5).max) // expect: 3
|
|
|
|
|
System.print((-2...-5).max) // expect: -2
|