summaryrefslogblamecommitdiff
path: root/test/junit/scala/collection/LinearSeqOptimizedTest.scala
blob: b9c34ed17c0baa74c850093e76b58438d99d16ed (plain) (tree)


















                                                            
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))
  }
}