summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorIchoran <ichoran@gmail.com>2014-06-04 03:41:45 -0700
committerIchoran <ichoran@gmail.com>2014-06-04 03:41:45 -0700
commita7ed0eba96d2032a8a23f2700eacfafbc250e7a0 (patch)
tree1df55d88326ab5f2fabfce959b1e218ef74e7643 /test/junit
parentb24e7573a17332606d9f9da49a397e02abec1b63 (diff)
parent7f08e00a3aa0f59314767313977d9f2899a80cd9 (diff)
downloadscala-a7ed0eba96d2032a8a23f2700eacfafbc250e7a0.tar.gz
scala-a7ed0eba96d2032a8a23f2700eacfafbc250e7a0.tar.bz2
scala-a7ed0eba96d2032a8a23f2700eacfafbc250e7a0.zip
Merge pull request #3743 from ruippeixotog/issue/8553
SI-8553 WrappedArray throws exception on lastIndexWhere when index out of range
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/collection/IndexedSeqOptimizedTest.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/junit/scala/collection/IndexedSeqOptimizedTest.scala b/test/junit/scala/collection/IndexedSeqOptimizedTest.scala
new file mode 100644
index 0000000000..e5382907af
--- /dev/null
+++ b/test/junit/scala/collection/IndexedSeqOptimizedTest.scala
@@ -0,0 +1,16 @@
+package scala.collection
+
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import org.junit.Assert._
+import org.junit.Test
+
+@RunWith(classOf[JUnit4])
+class IndexedSeqOptimizedTest {
+
+ @Test
+ def notThrowsAnExceptionInLastIndexOf() {
+ assertEquals(0, (Array(2): collection.mutable.WrappedArray[Int]).lastIndexWhere(_ => true, 1))
+ assertEquals(2, "abc123".lastIndexWhere(_.isLetter, 6))
+ }
+}