diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-18 09:01:51 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-18 09:01:51 -0700 |
commit | c5fdc815c30f0565a80a3837f368717a4e81e04d (patch) | |
tree | 48d2fc9de28b359fa9ef479e78388b9778f4ef52 /test/files/run/range.scala | |
parent | 42151a9980be37eae6e8fdf40330070361fd88fd (diff) | |
parent | f4267ccd96a9143c910c66a5b0436aaa64b7c9dc (diff) | |
download | scala-c5fdc815c30f0565a80a3837f368717a4e81e04d.tar.gz scala-c5fdc815c30f0565a80a3837f368717a4e81e04d.tar.bz2 scala-c5fdc815c30f0565a80a3837f368717a4e81e04d.zip |
Merge pull request #2961 from paulp/pr/whitespace
Cull extraneous whitespace.
Diffstat (limited to 'test/files/run/range.scala')
-rw-r--r-- | test/files/run/range.scala | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/files/run/range.scala b/test/files/run/range.scala index b81e67921a..4637ab874d 100644 --- a/test/files/run/range.scala +++ b/test/files/run/range.scala @@ -6,7 +6,7 @@ object Test { range.foreach(buffer += _); assert(buffer.toList == range.iterator.toList, buffer.toList+"/"+range.iterator.toList) } - + def boundaryTests() = { // #4321 assert((Int.MinValue to Int.MaxValue by Int.MaxValue).size == 3) @@ -28,31 +28,31 @@ object Test { ) assert(noElemAtMax) } - + case class GR[T](val x: T)(implicit val num: Integral[T]) { import num._ - + def negated = GR[T](-x) - + def gr1 = NumericRange(x, x, x) 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 gr5 = gr3.toList ::: negated.gr3.toList - + def check = { assert(gr1.isEmpty && !gr2.isEmpty) - assert(gr3.size == 9 && gr4.size == 10) + 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 = { implicit val imp1 = Numeric.BigDecimalAsIfIntegral implicit val imp2 = Numeric.DoubleAsIfIntegral - + val _grs = List[GR[_]]( GR(BigDecimal(5.0)), GR(BigInt(5)), @@ -62,21 +62,21 @@ object Test { ) val grs = _grs ::: (_grs map (_.negated)) grs foreach (_.check) - + assert(NumericRange(1, 10, 1) sameElements (1 until 10)) assert(NumericRange.inclusive(1, 10, 1) sameElements (1 to 10)) assert(NumericRange.inclusive(1, 100, 3) sameElements (1 to 100 by 3)) - + // #2518 assert((3L to 7 by 2) sameElements List(3L, 5L, 7L)) - + rangeForeach(1 to 10); rangeForeach(1 until 10); rangeForeach(10 to 1 by -1); rangeForeach(10 until 1 by -1); rangeForeach(10 to 1 by -3); rangeForeach(10 until 1 by -3); - + // living on the edges boundaryTests() } |