summaryrefslogtreecommitdiff
path: root/test/junit/scala/collection/LinearSeqOptimizedTest.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/junit/scala/collection/LinearSeqOptimizedTest.scala')
-rw-r--r--test/junit/scala/collection/LinearSeqOptimizedTest.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/junit/scala/collection/LinearSeqOptimizedTest.scala b/test/junit/scala/collection/LinearSeqOptimizedTest.scala
new file mode 100644
index 0000000000..b9c34ed17c
--- /dev/null
+++ b/test/junit/scala/collection/LinearSeqOptimizedTest.scala
@@ -0,0 +1,19 @@
+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 LinearSeqOptimizedTest {
+
+ @Test def `SI-9936 indexWhere`(): Unit = {
+ assertEquals(2, "abcde".indexOf('c', -1))
+ assertEquals(2, "abcde".indexOf('c', -2))
+ assertEquals(2, "abcde".toList.indexOf('c', -1))
+ assertEquals(2, "abcde".toList.indexOf('c', -2))
+ assertEquals(2, "abcde".toList.indexWhere(_ == 'c', -1))
+ assertEquals(2, "abcde".toList.indexWhere(_ == 'c', -2))
+ }
+}