summaryrefslogtreecommitdiff
path: root/test/files/run/stream_length.scala
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-05-28 15:34:32 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-05-28 15:34:32 +0000
commit0b006e7762a8c3ec2f5d02c8c7c34b09511e6a47 (patch)
treed506f42b6847b9ece5240d062bb9e4b97a450019 /test/files/run/stream_length.scala
parent5da8a164cdd276e191ab6429e5a64e02529bbe45 (diff)
downloadscala-0b006e7762a8c3ec2f5d02c8c7c34b09511e6a47.tar.gz
scala-0b006e7762a8c3ec2f5d02c8c7c34b09511e6a47.tar.bz2
scala-0b006e7762a8c3ec2f5d02c8c7c34b09511e6a47.zip
Re-enabled a number of previously disabled tests;
according to my tests, they all currently work.
Diffstat (limited to 'test/files/run/stream_length.scala')
-rw-r--r--test/files/run/stream_length.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/stream_length.scala b/test/files/run/stream_length.scala
new file mode 100644
index 0000000000..68e9cad5ac
--- /dev/null
+++ b/test/files/run/stream_length.scala
@@ -0,0 +1,15 @@
+
+
+object Test {
+ def walk(depth: Int, bias: String): Stream[String] = {
+ if (depth == 0)
+ Stream(bias)
+ else {
+ Stream.concat(Stream.range(1, 100).map((x: Int) => walk(depth-1, bias + x)))
+ }
+ }
+
+ def main(args: Array[String]) {
+ println("Length: " + walk(3, "---").length)
+ }
+}