@@ -555,65 +555,71 @@ class ChainSpec extends UnitSpec {
555
555
}
556
556
}
557
557
it should " have 2 indexOfSlice methods that take a GenSeq" in {
558
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 )) shouldBe 1
559
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 ), 3 ) shouldBe - 1
560
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 , 5 ), 3 ) shouldBe - 1
561
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 , 5 )) shouldBe - 1
562
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (5 )) shouldBe 4
563
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 )) shouldBe 0
564
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 ), 0 ) shouldBe 0
565
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 ), 1 ) shouldBe - 1
566
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 ), - 1 ) shouldBe 0
567
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List .empty) shouldBe 0
568
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List .empty, 6 ) shouldBe - 1
569
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List .empty, 4 ) shouldBe 4
558
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 ))
559
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 ), 3 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 ), 3 )
560
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 , 5 ), 3 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 , 5 ), 3 )
561
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 , 5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 , 5 ))
562
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 5 ))
563
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ))
564
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 ), 0 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ), 0 )
565
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 ), 1 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ), 1 )
566
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (1 , 2 , 3 , 4 , 5 ), - 1 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ), - 1 )
567
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List .empty) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List .empty)
568
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List .empty, 6 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List .empty, 6 )
569
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List .empty, 4 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List .empty, 4 )
570
570
571
571
val es = Chain (" one" , " two" , " three" , " four" , " five" )
572
- es.indexOfSlice(List (" one" , " two" )) shouldBe 0 ;
573
- es.indexOfSlice(List (" one" , " two" ), 1 ) shouldBe - 1
574
- es.indexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1 ;
572
+ val el = List (" one" , " two" , " three" , " four" , " five" )
573
+ es.indexOfSlice(List (" one" , " two" )) shouldBe el.indexOfSlice(List (" one" , " two" ))
574
+ es.indexOfSlice(List (" one" , " two" ), 1 ) shouldBe el.indexOfSlice(List (" one" , " two" ), 1 )
575
+ es.indexOfSlice(List (" ONE" , " TWO" )) shouldBe el.indexOfSlice(List (" ONE" , " TWO" ))
576
+
575
577
{
576
578
implicit val strEq = StringNormalizations .lowerCased.toEquality
577
- es.indexOfSlice(List (" one" , " two" )) shouldBe 0 ;
579
+ es.indexOfSlice(List (" one" , " two" )) shouldBe 0
578
580
es.indexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1
579
581
}
580
582
}
581
583
it should " have 2 indexOfSlice methods that take an Every" in {
582
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 )) shouldBe 1
583
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 ), 3 ) shouldBe - 1
584
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 , 5 ), 3 ) shouldBe - 1
585
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 , 5 )) shouldBe - 1
586
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (5 )) shouldBe 4
587
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 )) shouldBe 0
588
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 ), 0 ) shouldBe 0
589
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 ), 1 ) shouldBe - 1
590
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 ), - 1 ) shouldBe 0
584
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 2 , 3 ))
585
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 ), 3 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 2 , 3 ), 3 )
586
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 , 5 ), 3 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 2 , 3 , 5 ), 3 )
587
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 , 5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 2 , 3 , 5 ))
588
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 5 ))
589
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 1 , 2 , 3 , 4 , 5 ))
590
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 ), 0 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 1 , 2 , 3 , 4 , 5 ), 0 )
591
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 ), 1 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 1 , 2 , 3 , 4 , 5 ), 1 )
592
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (1 , 2 , 3 , 4 , 5 ), - 1 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( Every ( 1 , 2 , 3 , 4 , 5 ), - 1 )
591
593
592
594
val es = Chain (" one" , " two" , " three" , " four" , " five" )
593
- es.indexOfSlice(Every (" one" , " two" )) shouldBe 0 ;
594
- es.indexOfSlice(Every (" one" , " two" ), 1 ) shouldBe - 1
595
- es.indexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1 ;
595
+ val el = List (" one" , " two" , " three" , " four" , " five" )
596
+ es.indexOfSlice(Every (" one" , " two" )) shouldBe el.indexOfSlice(Every (" one" , " two" ))
597
+ es.indexOfSlice(Every (" one" , " two" ), 1 ) shouldBe el.indexOfSlice(Every (" one" , " two" ), 1 )
598
+ es.indexOfSlice(Every (" ONE" , " TWO" )) shouldBe el.indexOfSlice(Every (" ONE" , " TWO" ))
599
+
596
600
{
597
601
implicit val strEq = StringNormalizations .lowerCased.toEquality
598
602
es.indexOfSlice(Every (" one" , " two" )) shouldBe 0 ;
599
603
es.indexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1
600
604
}
601
605
}
602
606
it should " have 2 indexOfSlice methods that take a Chain" in {
603
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 )) shouldBe 1
604
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 ), 3 ) shouldBe - 1
605
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 , 5 ), 3 ) shouldBe - 1
606
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 , 5 )) shouldBe - 1
607
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (5 )) shouldBe 4
608
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 )) shouldBe 0
609
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 ), 0 ) shouldBe 0
610
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 ), 1 ) shouldBe - 1
611
- Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 ), - 1 ) shouldBe 0
607
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 ))
608
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 ), 3 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 ), 3 )
609
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 , 5 ), 3 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 , 5 ), 3 )
610
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 , 5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 2 , 3 , 5 ))
611
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 5 ))
612
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 )) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ))
613
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 ), 0 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ), 0 )
614
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 ), 1 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ), 1 )
615
+ Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (1 , 2 , 3 , 4 , 5 ), - 1 ) shouldBe List ( 1 , 2 , 3 , 4 , 5 ).indexOfSlice( List ( 1 , 2 , 3 , 4 , 5 ), - 1 )
612
616
613
617
val es = Chain (" one" , " two" , " three" , " four" , " five" )
614
- es.indexOfSlice(Chain (" one" , " two" )) shouldBe 0 ;
615
- es.indexOfSlice(Chain (" one" , " two" ), 1 ) shouldBe - 1
616
- es.indexOfSlice(Chain (" ONE" , " TWO" )) shouldBe - 1 ;
618
+ val el = Chain (" one" , " two" , " three" , " four" , " five" )
619
+ es.indexOfSlice(Chain (" one" , " two" )) shouldBe el.indexOfSlice(List (" one" , " two" ))
620
+ es.indexOfSlice(Chain (" one" , " two" ), 1 ) shouldBe el.indexOfSlice(List (" one" , " two" ), 1 )
621
+ es.indexOfSlice(Chain (" ONE" , " TWO" )) shouldBe el.indexOfSlice(List (" ONE" , " TWO" ))
622
+
617
623
{
618
624
implicit val strEq = StringNormalizations .lowerCased.toEquality
619
625
es.indexOfSlice(Chain (" one" , " two" )) shouldBe 0 ;
0 commit comments