diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/range.check | 0 | ||||
-rw-r--r-- | test/files/run/range.scala | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/range.check b/test/files/run/range.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/run/range.check diff --git a/test/files/run/range.scala b/test/files/run/range.scala new file mode 100644 index 0000000000..5d0ca84c0b --- /dev/null +++ b/test/files/run/range.scala @@ -0,0 +1,14 @@ +object Test extends Application{ + def rangeForeach(range : Range) = { + val buffer = new scala.collection.mutable.ListBuffer[Int]; + range.foreach(buffer += _); + assert(buffer.toList == range.elements.toList); + } + + 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); +} |