diff options
author | Paul Phillips <paulp@improving.org> | 2010-11-01 18:02:14 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-11-01 18:02:14 +0000 |
commit | 3953904fd0abf7c40b007dd94636177434657a36 (patch) | |
tree | 1501ed81445e34d81bc60e58db629422c6a7343f /test/files/run/range.scala | |
parent | d6b71cecda5802ffc4701f87b43929c4e3fc4127 (diff) | |
download | scala-3953904fd0abf7c40b007dd94636177434657a36.tar.gz scala-3953904fd0abf7c40b007dd94636177434657a36.tar.bz2 scala-3953904fd0abf7c40b007dd94636177434657a36.zip |
Achieved similar simplicity gains in NumericRan...
Achieved similar simplicity gains in NumericRange to those now in Range.
Obvious remaining task is to specialize NumericRange and after verifying
the performance, eliminate one or the other. For now, both soldier
onward despite near-convergence of implementation.
Closes #3232, no review.
Diffstat (limited to 'test/files/run/range.scala')
-rw-r--r-- | test/files/run/range.scala | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/files/run/range.scala b/test/files/run/range.scala index 02b48fad7c..31d90f2d6d 100644 --- a/test/files/run/range.scala +++ b/test/files/run/range.scala @@ -16,14 +16,15 @@ object Test { def gr2 = NumericRange.inclusive(x, x, x) def gr3 = NumericRange(x, x * fromInt(10), x) def gr4 = NumericRange.inclusive(x, x * fromInt(10), x) - - def check = assert( - gr1.isEmpty && !gr2.isEmpty && - gr3.size == 9 && gr4.size == 10 && - (gr3.toList ::: negated.gr3.toList).sum == num.zero && - !(gr3 contains (x * fromInt(10))) && - (gr4 contains (x * fromInt(10))) - ) + def gr5 = gr3.toList ::: negated.gr3.toList + + def check = { + assert(gr1.isEmpty && !gr2.isEmpty) + assert(gr3.size == 9 && gr4.size == 10) + assert(gr5.sum == num.zero, gr5.toString) + assert(!(gr3 contains (x * fromInt(10)))) + assert((gr4 contains (x * fromInt(10)))) + } } def main(args: Array[String]): Unit = { |