@@ -135,8 +135,8 @@ class ChainSpec extends UnitSpec {
135
135
}
136
136
}
137
137
it should " have an apply method" in {
138
- Chain (1 , 2 , 3 )(0 ) shouldEqual 1
139
- Chain (1 , 2 , 3 )(1 ) shouldEqual 2
138
+ Chain (1 , 2 , 3 )(0 ) shouldEqual 1
139
+ Chain (1 , 2 , 3 )(1 ) shouldEqual 2
140
140
Chain (" hi" )(0 ) shouldEqual " hi"
141
141
Chain (7 , 8 , 9 )(2 ) shouldEqual 9
142
142
the [IndexOutOfBoundsException ] thrownBy {
@@ -257,7 +257,7 @@ class ChainSpec extends UnitSpec {
257
257
// Could have an implicit conversion from Every[Char] to CharSequence like
258
258
// there is for Seq in Predef.
259
259
/*
260
- scala> Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).collect { case i if i > 10 == 0 => i / 2 }
260
+ scala> Vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).collect { case i if i > 10 == 0 => i / 2 }
261
261
res1: scala.collection.immutable.Vector[Int] = Vector()
262
262
*/
263
263
it should " have an collectFirst method" in {
@@ -286,13 +286,15 @@ class ChainSpec extends UnitSpec {
286
286
e.contains(3 ) shouldBe true
287
287
e.contains(4 ) shouldBe false
288
288
val es = Chain (" one" , " two" , " three" )
289
+ es.contains(" one" ) shouldBe true
290
+ es.contains(" ONE" ) shouldBe false
291
+ // SKIP-DOTTY-START
292
+ // https://github.com/lampepfl/dotty/issues/6114
293
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
294
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
289
295
es.contains(" one" ) shouldBe true ;
290
- es.contains(" ONE" ) shouldBe false ;
291
- {
292
- implicit val strEq = StringNormalizations .lowerCased.toEquality
293
- es.contains(" one" ) shouldBe true ;
294
- es.contains(" ONE" ) shouldBe false
295
- }
296
+ es.contains(" ONE" ) shouldBe false
297
+ // SKIP-DOTTY-END
296
298
}
297
299
// Decided to just overload one for GenSeq and one for Every. Could have done
298
300
// what that has a Slicing nature, but that's a bit too fancy pants.
@@ -380,7 +382,7 @@ class ChainSpec extends UnitSpec {
380
382
}
381
383
382
384
/*
383
- it should not have an drop method
385
+ it should not have an drop method
384
386
scala> Vector(1, 2, 3).drop(3)
385
387
res1: scala.collection.immutable.Vector[Int] = Vector()
386
388
@@ -545,14 +547,16 @@ class ChainSpec extends UnitSpec {
545
547
Chain (1 , 2 , 3 , 4 , 5 ).indexOf(5 , 3 ) shouldBe 4
546
548
547
549
val es = Chain (" one" , " two" , " three" )
548
- es.indexOf(" one" ) shouldBe 0 ;
550
+ es.indexOf(" one" ) shouldBe 0
549
551
es.indexOf(" one" , 1 ) shouldBe - 1
550
- es.indexOf(" ONE" ) shouldBe - 1 ;
551
- {
552
- implicit val strEq = StringNormalizations .lowerCased.toEquality
553
- es.indexOf(" one" ) shouldBe 0 ;
554
- es.indexOf(" ONE" ) shouldBe - 1
555
- }
552
+ es.indexOf(" ONE" ) shouldBe - 1
553
+ // SKIP-DOTTY-START
554
+ // https://github.com/lampepfl/dotty/issues/6114
555
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
556
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
557
+ es.indexOf(" one" ) shouldBe 0 ;
558
+ es.indexOf(" ONE" ) shouldBe - 1
559
+ // SKIP-DOTTY-END
556
560
}
557
561
it should " have 2 indexOfSlice methods that take a GenSeq" in {
558
562
Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 )) shouldBe List (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 ))
@@ -573,12 +577,13 @@ class ChainSpec extends UnitSpec {
573
577
es.indexOfSlice(List (" one" , " two" )) shouldBe el.indexOfSlice(List (" one" , " two" ))
574
578
es.indexOfSlice(List (" one" , " two" ), 1 ) shouldBe el.indexOfSlice(List (" one" , " two" ), 1 )
575
579
es.indexOfSlice(List (" ONE" , " TWO" )) shouldBe el.indexOfSlice(List (" ONE" , " TWO" ))
576
-
577
- {
578
- implicit val strEq = StringNormalizations .lowerCased.toEquality
579
- es.indexOfSlice(List (" one" , " two" )) shouldBe 0
580
- es.indexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1
581
- }
580
+ // SKIP-DOTTY-START
581
+ // https://github.com/lampepfl/dotty/issues/6114
582
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
583
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
584
+ es.indexOfSlice(List (" one" , " two" )) shouldBe 0
585
+ es.indexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1
586
+ // SKIP-DOTTY-END
582
587
}
583
588
it should " have 2 indexOfSlice methods that take an Every" in {
584
589
Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 )) shouldBe List (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Every (2 , 3 ))
@@ -597,11 +602,13 @@ class ChainSpec extends UnitSpec {
597
602
es.indexOfSlice(Every (" one" , " two" ), 1 ) shouldBe el.indexOfSlice(Every (" one" , " two" ), 1 )
598
603
es.indexOfSlice(Every (" ONE" , " TWO" )) shouldBe el.indexOfSlice(Every (" ONE" , " TWO" ))
599
604
600
- {
601
- implicit val strEq = StringNormalizations .lowerCased.toEquality
602
- es.indexOfSlice(Every (" one" , " two" )) shouldBe 0 ;
603
- es.indexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1
604
- }
605
+ // SKIP-DOTTY-START
606
+ // https://github.com/lampepfl/dotty/issues/6114
607
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
608
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
609
+ es.indexOfSlice(Every (" one" , " two" )) shouldBe 0 ;
610
+ es.indexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1
611
+ // SKIP-DOTTY-END
605
612
}
606
613
it should " have 2 indexOfSlice methods that take a Chain" in {
607
614
Chain (1 , 2 , 3 , 4 , 5 ).indexOfSlice(Chain (2 , 3 )) shouldBe List (1 , 2 , 3 , 4 , 5 ).indexOfSlice(List (2 , 3 ))
@@ -620,11 +627,13 @@ class ChainSpec extends UnitSpec {
620
627
es.indexOfSlice(Chain (" one" , " two" ), 1 ) shouldBe el.indexOfSlice(List (" one" , " two" ), 1 )
621
628
es.indexOfSlice(Chain (" ONE" , " TWO" )) shouldBe el.indexOfSlice(List (" ONE" , " TWO" ))
622
629
623
- {
624
- implicit val strEq = StringNormalizations .lowerCased.toEquality
625
- es.indexOfSlice(Chain (" one" , " two" )) shouldBe 0 ;
626
- es.indexOfSlice(Chain (" ONE" , " TWO" )) shouldBe - 1
627
- }
630
+ // SKIP-DOTTY-START
631
+ // https://github.com/lampepfl/dotty/issues/6114
632
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
633
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
634
+ es.indexOfSlice(Chain (" one" , " two" )) shouldBe 0 ;
635
+ es.indexOfSlice(Chain (" ONE" , " TWO" )) shouldBe - 1
636
+ // SKIP-DOTTY-END
628
637
}
629
638
it should " have 2 indexWhere methods" in {
630
639
Chain (1 , 2 , 3 , 4 , 5 ).indexWhere(_ == 3 ) shouldBe 2
@@ -692,12 +701,14 @@ class ChainSpec extends UnitSpec {
692
701
es.lastIndexOf(" two" ) shouldBe 1
693
702
es.lastIndexOf(" three" ) shouldBe 2
694
703
es.lastIndexOf(" three" , 1 ) shouldBe - 1
695
- es.lastIndexOf(" ONE" ) shouldBe - 1 ;
696
- {
697
- implicit val strEq = StringNormalizations .lowerCased.toEquality
698
- es.lastIndexOf(" one" ) shouldBe 0 ;
699
- es.lastIndexOf(" ONE" ) shouldBe - 1
700
- }
704
+ es.lastIndexOf(" ONE" ) shouldBe - 1
705
+ // SKIP-DOTTY-START
706
+ // https://github.com/lampepfl/dotty/issues/6114
707
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
708
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
709
+ es.lastIndexOf(" one" ) shouldBe 0
710
+ es.lastIndexOf(" ONE" ) shouldBe - 1
711
+ // SKIP-DOTTY-END
701
712
}
702
713
it should " have 2 lastIndexOfSlice methods that take a GenSeq" in {
703
714
Chain (1 , 2 , 3 , 4 , 5 ).lastIndexOfSlice(List (2 , 3 )) shouldBe 1
@@ -716,12 +727,14 @@ class ChainSpec extends UnitSpec {
716
727
val es = Chain (" one" , " two" , " three" , " four" , " five" )
717
728
es.lastIndexOfSlice(List (" one" , " two" )) shouldBe 0 ;
718
729
es.lastIndexOfSlice(List (" two" , " three" ), 0 ) shouldBe - 1
719
- es.lastIndexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1 ;
720
- {
721
- implicit val strEq = StringNormalizations .lowerCased.toEquality
722
- es.lastIndexOfSlice(List (" one" , " two" )) shouldBe 0 ;
723
- es.lastIndexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1
724
- }
730
+ es.lastIndexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1
731
+ // SKIP-DOTTY-START
732
+ // https://github.com/lampepfl/dotty/issues/6114
733
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
734
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
735
+ es.lastIndexOfSlice(List (" one" , " two" )) shouldBe 0
736
+ es.lastIndexOfSlice(List (" ONE" , " TWO" )) shouldBe - 1
737
+ // SKIP-DOTTY-END
725
738
}
726
739
it should " have 2 lastIndexOfSlice methods that take an Every" in {
727
740
Chain (1 , 2 , 3 , 4 , 5 ).lastIndexOfSlice(Every (2 , 3 )) shouldBe 1
@@ -735,14 +748,16 @@ class ChainSpec extends UnitSpec {
735
748
Chain (1 , 2 , 3 , 4 , 5 ).lastIndexOfSlice(Every (1 , 2 , 3 , 4 , 5 ), - 1 ) shouldBe - 1
736
749
737
750
val es = Chain (" one" , " two" , " three" , " four" , " five" )
738
- es.lastIndexOfSlice(Every (" one" , " two" )) shouldBe 0 ;
751
+ es.lastIndexOfSlice(Every (" one" , " two" )) shouldBe 0
739
752
es.lastIndexOfSlice(Every (" two" , " three" ), 0 ) shouldBe - 1
740
- es.lastIndexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1 ;
741
- {
742
- implicit val strEq = StringNormalizations .lowerCased.toEquality
743
- es.lastIndexOfSlice(Every (" one" , " two" )) shouldBe 0 ;
744
- es.lastIndexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1
745
- }
753
+ es.lastIndexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1
754
+ // SKIP-DOTTY-START
755
+ // https://github.com/lampepfl/dotty/issues/6114
756
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
757
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
758
+ es.lastIndexOfSlice(Every (" one" , " two" )) shouldBe 0
759
+ es.lastIndexOfSlice(Every (" ONE" , " TWO" )) shouldBe - 1
760
+ // SKIP-DOTTY-END
746
761
}
747
762
it should " have 2 lastIndexOfSlice methods that take a Chain" in {
748
763
Chain (1 , 2 , 3 , 4 , 5 ).lastIndexOfSlice(Chain (2 , 3 )) shouldBe 1
@@ -758,12 +773,14 @@ class ChainSpec extends UnitSpec {
758
773
val es = Chain (" one" , " two" , " three" , " four" , " five" )
759
774
es.lastIndexOfSlice(Chain (" one" , " two" )) shouldBe 0 ;
760
775
es.lastIndexOfSlice(Chain (" two" , " three" ), 0 ) shouldBe - 1
761
- es.lastIndexOfSlice(Chain (" ONE" , " TWO" )) shouldBe - 1 ;
762
- {
763
- implicit val strEq = StringNormalizations .lowerCased.toEquality
764
- es.lastIndexOfSlice(Chain (" one" , " two" )) shouldBe 0 ;
765
- es.lastIndexOfSlice(Chain (" ONE" , " TWO" )) shouldBe - 1
766
- }
776
+ es.lastIndexOfSlice(Chain (" ONE" , " TWO" )) shouldBe - 1
777
+ // SKIP-DOTTY-START
778
+ // https://github.com/lampepfl/dotty/issues/6114
779
+ implicit val strEq = StringNormalizations .lowerCased.toEquality
780
+ // DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
781
+ es.lastIndexOfSlice(Chain (" one" , " two" )) shouldBe 0
782
+ es.lastIndexOfSlice(Chain (" ONE" , " TWO" )) shouldBe - 1
783
+ // SKIP-DOTTY-END
767
784
}
768
785
it should " have 2 lastIndexWhere methods" in {
769
786
Chain (1 , 2 , 3 , 4 , 5 ).lastIndexWhere(_ == 2 ) shouldBe 1
@@ -829,8 +846,11 @@ class ChainSpec extends UnitSpec {
829
846
}
830
847
it should " have a mkString method" in {
831
848
849
+ // SKIP-DOTTY-START
850
+ // https://github.com/lampepfl/dotty/issues/6705
832
851
Chain (" hi" ).mkString shouldBe " hi"
833
852
Chain (1 , 2 , 3 ).mkString shouldBe " 123"
853
+ // SKIP-DOTTY-END
834
854
835
855
Chain (" hi" ).mkString(" #" ) shouldBe " hi"
836
856
Chain (1 , 2 , 3 ).mkString(" #" ) shouldBe " 1#2#3"
@@ -1217,7 +1237,7 @@ class ChainSpec extends UnitSpec {
1217
1237
scala> Vector(1, 2, 3).take(-1)
1218
1238
res12: scala.collection.immutable.Vector[Int] = Vector()
1219
1239
1220
- it should not have a takeRight method
1240
+ it should not have a takeRight method
1221
1241
scala> Vector(1).takeRight(1)
1222
1242
res13: scala.collection.immutable.Vector[Int] = Vector(1)
1223
1243
scala> Vector(1).takeRight(0)
0 commit comments