From 95f21ca8a095767202e1c4d620a865c1647d7e6c Mon Sep 17 00:00:00 2001 From: Rex Kerr Date: Thu, 30 Jan 2014 12:28:14 -0800 Subject: 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). --- test/junit/scala/collection/NumericRangeTest.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/junit') 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)) + } } } -- cgit v1.2.3