Skip to content

Commit

Permalink
Cleanup testcase
Browse files Browse the repository at this point in the history
No need to check the output - checking programmatically that the
produced streams are empty is enough.
  • Loading branch information
Blaisorblade committed Aug 22, 2012
1 parent 096a08e commit 15ed4f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions test/files/run/stream-stack-overflow-filter-map.check

This file was deleted.

6 changes: 2 additions & 4 deletions 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)
Expand Down

0 comments on commit 15ed4f0

Please sign in to comment.