summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/run/lists.scala23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/files/run/lists.scala b/test/files/run/lists.scala
index 2d55563f60..665cf51970 100644
--- a/test/files/run/lists.scala
+++ b/test/files/run/lists.scala
@@ -14,7 +14,8 @@ import testing.SUnit._
object Test extends TestConsoleMain {
def suite = new TestSuite(
Test1, //count, exists, filter, ..
- Test2 //#468
+ Test2, //#468
+ Test3 //#1691
)
}
@@ -105,3 +106,23 @@ object Test2 extends TestCase("t0468") with Assert {
assertEquals("check_++", 14, n2 + n3 + n4)
}
}
+
+object Test3 extends TestCase("t1691") with Assert {
+ override def enableStackTrace = false
+ override def runTest {
+ try {
+ List.range(1, 10, 0)
+ } catch {
+ case e: IllegalArgumentException => ()
+ case _ => throw new Error("List.range(1, 10, 0)")
+ }
+ try {
+ List.range(1, 10, x => 4)
+ } catch {
+ case e: IllegalArgumentException => ()
+ case _ => throw new Error("List.range(1, 10, x => 4)")
+ }
+ assertEquals(List.range(10, 0, x => x - 2),
+ List(10, 8, 6, 4, 2))
+ }
+}