Permalink
Browse files

Cleanup testcase

No need to check the output - checking programmatically that the
produced streams are empty is enough.
  • Loading branch information...
1 parent 096a08e commit 15ed4f044f3e518f627b918df77a961bcef2f55f @Blaisorblade Blaisorblade committed Aug 20, 2012
View
2 test/files/run/stream-stack-overflow-filter-map.check
@@ -1,2 +0,0 @@
-Stream()
-Stream()
View
6 test/files/run/stream-stack-overflow-filter-map.scala
@@ -1,12 +1,10 @@
object Test extends App {
- //This runs fine.
val resFMap1 = (1 to 10000).toStream filter (_ => false) flatMap (Seq(_))
val resMap1 = (1 to 10000).toStream filter (_ => false) map (_ + 1)
assert(resMap1.isEmpty)
assert(resFMap1.isEmpty)
- println(resMap1)
- println(resFMap1)
- //This will cause a stack overflow
+
+ //This risks causing a stack overflow
val resFMap2 = (1 to 10000).toStream withFilter (_ => false) flatMap (Seq(_))
val resMap2 = (1 to 10000).toStream withFilter (_ => false) map (_ + 1)
assert(resMap1 == resMap2)

0 comments on commit 15ed4f0

Please sign in to comment.