diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/iterators.check | 2 | ||||
-rw-r--r-- | test/files/run/iterators.scala | 24 |
2 files changed, 21 insertions, 5 deletions
diff --git a/test/files/run/iterators.check b/test/files/run/iterators.check index 405fa5abc5..a4b1053577 100644 --- a/test/files/run/iterators.check +++ b/test/files/run/iterators.check @@ -1,5 +1,7 @@ +test check_from was successful test check_range was successful test check_take was successful test check_drop was successful test check_foreach was successful +test check_forall was successful diff --git a/test/files/run/iterators.scala b/test/files/run/iterators.scala index dde11048d9..7d1e44a0df 100644 --- a/test/files/run/iterators.scala +++ b/test/files/run/iterators.scala @@ -7,12 +7,18 @@ object Test { + def check_from: Int = { + val it1 = Iterator.from(-1); + val it2 = Iterator.from(0, -1); + it1.next + it2.next + } + def check_range: Int = { - val xs1 = Iterator.range(0, 10, 2) toList; - val xs2 = Iterator.range(0, 10, -2) toList; - val xs3 = Iterator.range(10, 0, -2) toList; - val xs4 = Iterator.range(10, 0, 2) toList; - xs1.length + xs2.length + xs3.length + xs4.length + val xs1 = Iterator.range(0, 10, 2) toList; + val xs2 = Iterator.range(0, 10, -2) toList; + val xs3 = Iterator.range(10, 0, -2) toList; + val xs4 = Iterator.range(10, 0, 2) toList; + xs1.length + xs2.length + xs3.length + xs4.length } def check_take: Int = { @@ -36,6 +42,12 @@ object Test { n } + def check_forall: Int = { + val it1 = Iterator.from(0); + val it2 = Iterator.from(1); + 0 + } + def check_success[A](name: String, closure: => A, expected: A): Unit = { Console.print("test " + name); try { @@ -54,10 +66,12 @@ object Test { } def main(args: Array[String]): Unit = { + check_success("check_from", check_from, -1); check_success("check_range", check_range, 10); check_success("check_take", check_take, 10); check_success("check_drop", check_drop, 12); check_success("check_foreach", check_foreach, 190); + check_success("check_forall", check_forall, 0); Console.println; } } |