diff options
author | Rex Kerr <ichoran@gmail.com> | 2014-01-30 12:28:14 -0800 |
---|---|---|
committer | Rex Kerr <ichoran@gmail.com> | 2014-02-09 08:29:13 -0800 |
commit | 95f21ca8a095767202e1c4d620a865c1647d7e6c (patch) | |
tree | c33429ea26538b29817949ceac9a9ee09bb0c252 /test | |
parent | 08e51dfec50842253afb87cc5ae3c7400dc18ced (diff) | |
download | scala-95f21ca8a095767202e1c4d620a865c1647d7e6c.tar.gz scala-95f21ca8a095767202e1c4d620a865c1647d7e6c.tar.bz2 scala-95f21ca8a095767202e1c4d620a865c1647d7e6c.zip |
SI-6736 Range.contains is wrong
Removed once-used private method that was calculating ranges in error and corrected the contains method (plus improved performance).
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/collection/NumericRangeTest.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/junit/scala/collection/NumericRangeTest.scala b/test/junit/scala/collection/NumericRangeTest.scala index 0260723b9d..f03bf1c498 100644 --- a/test/junit/scala/collection/NumericRangeTest.scala +++ b/test/junit/scala/collection/NumericRangeTest.scala @@ -6,7 +6,7 @@ import org.junit.Test import scala.math._ import scala.util._ -/* Tests various maps by making sure they all agree on the same answers. */ +/* Tests various ranges by making sure they all agree on the same answers. */ @RunWith(classOf[JUnit4]) class RangeConsistencyTest { def r2nr[T: Integral]( @@ -120,4 +120,9 @@ class RangeConsistencyTest { case _ => false } }} + + @Test + def testSI6736() { assert{ + (0 to Int.MaxValue).contains(4) && !((Int.MinValue to 0).contains(4)) + } } } |