diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-11-07 09:55:10 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-11-07 09:55:10 +0000 |
commit | da929738ccfcf21cc3d8fdb9ce7734e59c6847f0 (patch) | |
tree | 90e335ca1fb60fde22ad345df72aeb0f08aace22 /test/files/pos/scan.scala | |
parent | c4e1b28cf79f73e4f8972263efb85ee879c39ebd (diff) | |
download | scala-da929738ccfcf21cc3d8fdb9ce7734e59c6847f0.tar.gz scala-da929738ccfcf21cc3d8fdb9ce7734e59c6847f0.tar.bz2 scala-da929738ccfcf21cc3d8fdb9ce7734e59c6847f0.zip |
Backport of r25948
Diffstat (limited to 'test/files/pos/scan.scala')
-rw-r--r-- | test/files/pos/scan.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/files/pos/scan.scala b/test/files/pos/scan.scala index 47e0a7d976..f056c77ba1 100644 --- a/test/files/pos/scan.scala +++ b/test/files/pos/scan.scala @@ -6,17 +6,17 @@ object Test { def main(args: Array[String]) { val lst = List(1, 2, 3, 4, 5) - + assert(lst.scanLeft(0)(_ + _) == List(0, 1, 3, 6, 10, 15)) assert(lst.scanRight(0)(_ + _) == List(15, 14, 12, 9, 5, 0)) - + val emp = List[Int]() assert(emp.scanLeft(0)(_ + _) == List(0)) assert(emp.scanRight(0)(_ + _) == List(0)) - + val stream = Stream(1, 2, 3, 4, 5) assert(stream.scanLeft(0)(_ + _) == Stream(0, 1, 3, 6, 10, 15)) - + assert(Stream.from(1).scanLeft(0)(_ + _).take(5) == Stream(0, 1, 3, 6, 10)) } |