diff options
author | Philipp Haller <hallerp@gmail.com> | 2008-08-28 16:46:26 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2008-08-28 16:46:26 +0000 |
commit | f0ab2e175e6b64f3356e2472db81e2caad6684a5 (patch) | |
tree | 640cb863fe4b49e87044dd999a4cca1fcda79b50 /test/files | |
parent | d0299fb471e99d2cdf35325cb1823336185c752d (diff) | |
download | scala-f0ab2e175e6b64f3356e2472db81e2caad6684a5.tar.gz scala-f0ab2e175e6b64f3356e2472db81e2caad6684a5.tar.bz2 scala-f0ab2e175e6b64f3356e2472db81e2caad6684a5.zip |
Added test files for #1297
Diffstat (limited to 'test/files')
-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); +} |