diff options
author | michelou <michelou@epfl.ch> | 2007-10-05 16:48:02 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-10-05 16:48:02 +0000 |
commit | 41865ed00183a049d6fbaebc97897eebd2956d68 (patch) | |
tree | 4d88344154774c1a95046f8f22771d6f7a5f0e72 /test/files/run | |
parent | 6761dc14b707667b453455aa6cecb0c82babeed3 (diff) | |
download | scala-41865ed00183a049d6fbaebc97897eebd2956d68.tar.gz scala-41865ed00183a049d6fbaebc97897eebd2956d68.tar.bz2 scala-41865ed00183a049d6fbaebc97897eebd2956d68.zip |
fixed ticket #153
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/streams.check | 1 | ||||
-rw-r--r-- | test/files/run/streams.scala | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/test/files/run/streams.check b/test/files/run/streams.check index 04d92425d9..d11eb7f67a 100644 --- a/test/files/run/streams.check +++ b/test/files/run/streams.check @@ -15,3 +15,4 @@ Stream() Stream(1, 2) Stream() +65536 diff --git a/test/files/run/streams.scala b/test/files/run/streams.scala index cd1185344b..408affe306 100644 --- a/test/files/run/streams.scala +++ b/test/files/run/streams.scala @@ -21,4 +21,9 @@ object Test extends Application { println(s2.drop(-1)) println(s2.dropWhile(_ > 0)) println + + // ticket #153 + def powers(x: Int) = if ((x&(x-1)) == 0) Some(x) else None + val s3 = Stream.range(1, 100000) + println(s3.flatMap(powers).reverse.head) } |