summaryrefslogtreecommitdiff
path: root/test/files/run/t4658.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t4658.scala')
-rw-r--r--test/files/run/t4658.scala11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/files/run/t4658.scala b/test/files/run/t4658.scala
index 8c07c50694..7fc6d4584c 100644
--- a/test/files/run/t4658.scala
+++ b/test/files/run/t4658.scala
@@ -2,6 +2,7 @@ import scala.collection.immutable.NumericRange
//#4658
object Test {
+ // Only works for Int values! Need to rethink explicit otherwise.
case class R(start: Int, end: Int, step: Int = 1, inclusive: Boolean = true)
val rangeData = Array(
@@ -28,6 +29,14 @@ object Test {
numericLongRanges.foreach{range => println(range.sum)}
println("BigIntRanges:")
numericBigIntRanges.foreach{range => println(range.sum)}
+ println("BigInt agrees with Long: " +
+ (numericLongRanges zip numericBigIntRanges).forall{ case (lr, bir) => lr.sum == bir.sum }
+ )
+ println("Long agrees with Int when rounded: " +
+ (numericLongRanges zip numericIntRanges).forall{ case (lr, ir) => lr.sum.toInt == ir.sum }
+ )
+ println("Numeric Int agrees with Range: " +
+ (numericIntRanges zip ranges).forall{ case (ir, r) => ir.sum == r.sum }
+ )
}
-
} \ No newline at end of file