summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/collection/NumericRangeTest.scala18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/junit/scala/collection/NumericRangeTest.scala b/test/junit/scala/collection/NumericRangeTest.scala
index f03bf1c498..3980c31577 100644
--- a/test/junit/scala/collection/NumericRangeTest.scala
+++ b/test/junit/scala/collection/NumericRangeTest.scala
@@ -122,7 +122,19 @@ class RangeConsistencyTest {
}}
@Test
- def testSI6736() { assert{
- (0 to Int.MaxValue).contains(4) && !((Int.MinValue to 0).contains(4))
- } }
+ def testSI6736() {
+ // These operations on overfull ranges should all succeed.
+ assert( (0 to Int.MaxValue).contains(4) )
+ assert( !((Int.MinValue to 0).contains(4)) )
+ assert( (Int.MinValue to 0).last == 0 )
+ assert( (Int.MinValue until 5).last == 4 )
+ assert( (-7 to -99 by -4).last == -99 && (-7 until -99 by -4).last == -95 )
+ assert( (Int.MinValue to 5) == (Int.MinValue until 6) )
+ assert( (-3 to Int.MaxValue).drop(4).length == Int.MaxValue )
+ assert( (-3 to Int.MaxValue).take(1234) == (-3 to 1230) )
+ assert( (-3 to Int.MaxValue).dropRight(4).length == Int.MaxValue )
+ assert( (-3 to Int.MaxValue).takeRight(1234).length == 1234 )
+ assert( (-3 to Int.MaxValue).dropWhile(_ <= 0).length == Int.MaxValue )
+ assert( (-3 to Int.MaxValue).span(_ <= 0) match { case (a,b) => a.length == 4 && b.length == Int.MaxValue } )
+ }
}