summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTiark Rompf <tiark.rompf@epfl.ch>2009-10-30 07:51:19 +0000
committerTiark Rompf <tiark.rompf@epfl.ch>2009-10-30 07:51:19 +0000
commit6ae7f2cbc183d57ba7d00fe790889f359c7b3a11 (patch)
tree66700f3cdb7fd3c29ee28e6b58c77c947cb52a98 /test
parentc5157c830cc515c7bd0b5b23ca2cecde77609c8d (diff)
downloadscala-6ae7f2cbc183d57ba7d00fe790889f359c7b3a11.tar.gz
scala-6ae7f2cbc183d57ba7d00fe790889f359c7b3a11.tar.bz2
scala-6ae7f2cbc183d57ba7d00fe790889f359c7b3a11.zip
fixed 2544, reimplemented SeqLike.indexWhere, s...
fixed 2544, reimplemented SeqLike.indexWhere, segmentLength and lengthCompare in terms of iterators instead of foreach and breaks
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t2544.check10
-rw-r--r--test/files/run/t2544.scala19
2 files changed, 29 insertions, 0 deletions
diff --git a/test/files/run/t2544.check b/test/files/run/t2544.check
new file mode 100644
index 0000000000..716b146ac4
--- /dev/null
+++ b/test/files/run/t2544.check
@@ -0,0 +1,10 @@
+2
+2
+3
+3
+-2
+-2
+1
+1
+0
+0
diff --git a/test/files/run/t2544.scala b/test/files/run/t2544.scala
new file mode 100644
index 0000000000..7e7cfeb357
--- /dev/null
+++ b/test/files/run/t2544.scala
@@ -0,0 +1,19 @@
+object Test {
+ object Foo extends Seq[Int] {
+ def apply(i: Int) = i
+ def length = 4
+ def iterator = Iterator(0,1,2,3,4)
+ }
+ def main(args: Array[String]) = {
+ println(Foo indexWhere(_ >= 2,1))
+ println(Foo.toList indexWhere(_ >= 2,1))
+ println(Foo segmentLength(_ <= 3,1))
+ println(Foo.toList segmentLength(_ <= 3,1))
+ println(Foo lengthCompare 7)
+ println(Foo.toList lengthCompare 7)
+ println(Foo lengthCompare 2)
+ println(Foo.toList lengthCompare 2)
+ println(Foo lengthCompare 5)
+ println(Foo.toList lengthCompare 5)
+ }
+} \ No newline at end of file