diff options
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/scan.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/pos/scan.scala b/test/files/pos/scan.scala index a88abe63d2..47e0a7d976 100644 --- a/test/files/pos/scan.scala +++ b/test/files/pos/scan.scala @@ -13,6 +13,11 @@ object Test { 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)) } }
\ No newline at end of file |