diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-05-18 21:16:31 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-05-18 21:16:31 +0000 |
commit | da8253c2e07a8e461c1ece23e68fb2b72a638dd2 (patch) | |
tree | 53d9186d7fdd9561769376863c9167776a211f43 /test/files/run | |
parent | 1b06a599ca7d79557e47e9f8ae37fa9fa07979c0 (diff) | |
download | scala-da8253c2e07a8e461c1ece23e68fb2b72a638dd2.tar.gz scala-da8253c2e07a8e461c1ece23e68fb2b72a638dd2.tar.bz2 scala-da8253c2e07a8e461c1ece23e68fb2b72a638dd2.zip |
Fixes #3444. Review by phaller.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/iterator3444.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/files/run/iterator3444.scala b/test/files/run/iterator3444.scala new file mode 100644 index 0000000000..1d0713addc --- /dev/null +++ b/test/files/run/iterator3444.scala @@ -0,0 +1,23 @@ + + +// ticked #3444 +object Test { + + def main(args: Array[String]) { + val it = (1 to 12).toSeq.iterator + + assert(it.next == 1) + assert(it.take(2).toList == List(2, 3)) + + val jt = (4 to 12).toSeq.iterator + assert(jt.next == 4) + assert(jt.drop(5).toList == List(10, 11, 12)) + + val kt = (1 until 10).toSeq.iterator + assert(kt.drop(50).toList == Nil) + + val mt = (1 until 5).toSeq.iterator + assert(mt.take(50).toList == List(1, 2, 3, 4)) + } + +} |