Skip to content

Commit 94d5031

Browse files
authored
Merge pull request scalatest#6 from cheeseng/dotty-scala-2.12-fix
Scala 2.12 Build Fix
2 parents 44fb550 + 0e2fc4d commit 94d5031

File tree

8 files changed

+185
-229
lines changed

8 files changed

+185
-229
lines changed

scalactic-test/src/test/scala/org/scalactic/ChainSpec.scala

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,10 @@ class ChainSpec extends UnitSpec {
290290
es.contains("ONE") shouldBe false
291291
// SKIP-DOTTY-START
292292
// https://github.com/lampepfl/dotty/issues/6114
293-
{
294-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
295-
es.contains("one") shouldBe true;
296-
es.contains("ONE") shouldBe false
297-
}
293+
implicit val strEq = StringNormalizations.lowerCased.toEquality
294+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
295+
es.contains("one") shouldBe true;
296+
es.contains("ONE") shouldBe false
298297
// SKIP-DOTTY-END
299298
}
300299
// Decided to just overload one for GenSeq and one for Every. Could have done
@@ -553,11 +552,10 @@ class ChainSpec extends UnitSpec {
553552
es.indexOf("ONE") shouldBe -1
554553
// SKIP-DOTTY-START
555554
// https://github.com/lampepfl/dotty/issues/6114
556-
{
557-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
558-
es.indexOf("one") shouldBe 0;
559-
es.indexOf("ONE") shouldBe -1
560-
}
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
561559
// SKIP-DOTTY-END
562560
}
563561
it should "have 2 indexOfSlice methods that take a GenSeq" in {
@@ -581,11 +579,10 @@ class ChainSpec extends UnitSpec {
581579
es.indexOfSlice(List("ONE", "TWO")) shouldBe el.indexOfSlice(List("ONE", "TWO"))
582580
// SKIP-DOTTY-START
583581
// https://github.com/lampepfl/dotty/issues/6114
584-
{
585-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
586-
es.indexOfSlice(List("one", "two")) shouldBe 0
587-
es.indexOfSlice(List("ONE", "TWO")) shouldBe -1
588-
}
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
589586
// SKIP-DOTTY-END
590587
}
591588
it should "have 2 indexOfSlice methods that take an Every" in {
@@ -607,11 +604,10 @@ class ChainSpec extends UnitSpec {
607604

608605
// SKIP-DOTTY-START
609606
// https://github.com/lampepfl/dotty/issues/6114
610-
{
611-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
612-
es.indexOfSlice(Every("one", "two")) shouldBe 0;
613-
es.indexOfSlice(Every("ONE", "TWO")) shouldBe -1
614-
}
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
615611
// SKIP-DOTTY-END
616612
}
617613
it should "have 2 indexOfSlice methods that take a Chain" in {
@@ -633,11 +629,10 @@ class ChainSpec extends UnitSpec {
633629

634630
// SKIP-DOTTY-START
635631
// https://github.com/lampepfl/dotty/issues/6114
636-
{
637-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
638-
es.indexOfSlice(Chain("one", "two")) shouldBe 0;
639-
es.indexOfSlice(Chain("ONE", "TWO")) shouldBe -1
640-
}
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
641636
// SKIP-DOTTY-END
642637
}
643638
it should "have 2 indexWhere methods" in {
@@ -709,11 +704,10 @@ class ChainSpec extends UnitSpec {
709704
es.lastIndexOf("ONE") shouldBe -1
710705
// SKIP-DOTTY-START
711706
// https://github.com/lampepfl/dotty/issues/6114
712-
{
713-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
714-
es.lastIndexOf("one") shouldBe 0
715-
es.lastIndexOf("ONE") shouldBe -1
716-
}
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
717711
// SKIP-DOTTY-END
718712
}
719713
it should "have 2 lastIndexOfSlice methods that take a GenSeq" in {
@@ -736,11 +730,10 @@ class ChainSpec extends UnitSpec {
736730
es.lastIndexOfSlice(List("ONE", "TWO")) shouldBe -1
737731
// SKIP-DOTTY-START
738732
// https://github.com/lampepfl/dotty/issues/6114
739-
{
740-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
741-
es.lastIndexOfSlice(List("one", "two")) shouldBe 0
742-
es.lastIndexOfSlice(List("ONE", "TWO")) shouldBe -1
743-
}
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
744737
// SKIP-DOTTY-END
745738
}
746739
it should "have 2 lastIndexOfSlice methods that take an Every" in {
@@ -760,11 +753,10 @@ class ChainSpec extends UnitSpec {
760753
es.lastIndexOfSlice(Every("ONE", "TWO")) shouldBe -1
761754
// SKIP-DOTTY-START
762755
// https://github.com/lampepfl/dotty/issues/6114
763-
{
764-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
765-
es.lastIndexOfSlice(Every("one", "two")) shouldBe 0
766-
es.lastIndexOfSlice(Every("ONE", "TWO")) shouldBe -1
767-
}
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
768760
// SKIP-DOTTY-END
769761
}
770762
it should "have 2 lastIndexOfSlice methods that take a Chain" in {
@@ -784,11 +776,10 @@ class ChainSpec extends UnitSpec {
784776
es.lastIndexOfSlice(Chain("ONE", "TWO")) shouldBe -1
785777
// SKIP-DOTTY-START
786778
// https://github.com/lampepfl/dotty/issues/6114
787-
{
788-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
789-
es.lastIndexOfSlice(Chain("one", "two")) shouldBe 0
790-
es.lastIndexOfSlice(Chain("ONE", "TWO")) shouldBe -1
791-
}
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
792783
// SKIP-DOTTY-END
793784
}
794785
it should "have 2 lastIndexWhere methods" in {

scalactic-test/src/test/scala/org/scalactic/anyvals/NonEmptyArraySpec.scala

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,10 @@ class NonEmptyArraySpec extends UnitSpec {
266266
es.contains("ONE") shouldBe false;
267267
// SKIP-DOTTY-START
268268
// https://github.com/lampepfl/dotty/issues/6114
269-
{
270-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
271-
es.contains("one") shouldBe true;
272-
es.contains("ONE") shouldBe false
273-
}
269+
implicit val strEq = StringNormalizations.lowerCased.toEquality
270+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
271+
es.contains("one") shouldBe true;
272+
es.contains("ONE") shouldBe false
274273
// SKIP-DOTTY-END
275274
}
276275
// Decided to just overload one for GenSeq and one for Every. Could have done
@@ -576,11 +575,10 @@ class NonEmptyArraySpec extends UnitSpec {
576575
es.indexOf("ONE") shouldBe -1
577576
// SKIP-DOTTY-START
578577
// https://github.com/lampepfl/dotty/issues/6114
579-
{
580-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
581-
es.indexOf("one") shouldBe 0
582-
es.indexOf("ONE") shouldBe -1
583-
}
578+
implicit val strEq = StringNormalizations.lowerCased.toEquality
579+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
580+
es.indexOf("one") shouldBe 0
581+
es.indexOf("ONE") shouldBe -1
584582
// SKIP-DOTTY-END
585583
}
586584
it should "have 2 indexOfSlice methods that take a GenSeq" in {
@@ -603,11 +601,10 @@ class NonEmptyArraySpec extends UnitSpec {
603601
es.indexOfSlice(Array("ONE", "TWO")) shouldBe -1
604602
// SKIP-DOTTY-START
605603
// https://github.com/lampepfl/dotty/issues/6114
606-
{
607-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
608-
es.indexOfSlice(Array("one", "two")) shouldBe 0
609-
es.indexOfSlice(Array("ONE", "TWO")) shouldBe -1
610-
}
604+
implicit val strEq = StringNormalizations.lowerCased.toEquality
605+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
606+
es.indexOfSlice(Array("one", "two")) shouldBe 0
607+
es.indexOfSlice(Array("ONE", "TWO")) shouldBe -1
611608
// SKIP-DOTTY-END
612609
}
613610
it should "have 2 indexOfSlice methods that take an Every" in {
@@ -627,11 +624,10 @@ class NonEmptyArraySpec extends UnitSpec {
627624
es.indexOfSlice(Every("ONE", "TWO")) shouldBe -1
628625
// SKIP-DOTTY-START
629626
// https://github.com/lampepfl/dotty/issues/6114
630-
{
631-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
632-
es.indexOfSlice(Every("one", "two")) shouldBe 0
633-
es.indexOfSlice(Every("ONE", "TWO")) shouldBe -1
634-
}
627+
implicit val strEq = StringNormalizations.lowerCased.toEquality
628+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
629+
es.indexOfSlice(Every("one", "two")) shouldBe 0
630+
es.indexOfSlice(Every("ONE", "TWO")) shouldBe -1
635631
// SKIP-DOTTY-END
636632
}
637633
it should "have 2 indexOfSlice methods that take a NonEmptyArray" in {
@@ -651,11 +647,10 @@ class NonEmptyArraySpec extends UnitSpec {
651647
es.indexOfSlice(NonEmptyArray("ONE", "TWO")) shouldBe -1
652648
// SKIP-DOTTY-START
653649
// https://github.com/lampepfl/dotty/issues/6114
654-
{
655-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
656-
es.indexOfSlice(NonEmptyArray("one", "two")) shouldBe 0
657-
es.indexOfSlice(NonEmptyArray("ONE", "TWO")) shouldBe -1
658-
}
650+
implicit val strEq = StringNormalizations.lowerCased.toEquality
651+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
652+
es.indexOfSlice(NonEmptyArray("one", "two")) shouldBe 0
653+
es.indexOfSlice(NonEmptyArray("ONE", "TWO")) shouldBe -1
659654
// SKIP-DOTTY-END
660655
}
661656
it should "have 2 indexWhere methods" in {
@@ -727,11 +722,10 @@ class NonEmptyArraySpec extends UnitSpec {
727722
es.lastIndexOf("ONE") shouldBe -1
728723
// SKIP-DOTTY-START
729724
// https://github.com/lampepfl/dotty/issues/6114
730-
{
731-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
732-
es.lastIndexOf("one") shouldBe 0
733-
es.lastIndexOf("ONE") shouldBe -1
734-
}
725+
implicit val strEq = StringNormalizations.lowerCased.toEquality
726+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
727+
es.lastIndexOf("one") shouldBe 0
728+
es.lastIndexOf("ONE") shouldBe -1
735729
// SKIP-DOTTY-END
736730
}
737731
it should "have 2 lastIndexOfSlice methods that take a GenSeq" in {
@@ -754,11 +748,10 @@ class NonEmptyArraySpec extends UnitSpec {
754748
es.lastIndexOfSlice(Array("ONE", "TWO")) shouldBe -1
755749
// SKIP-DOTTY-START
756750
// https://github.com/lampepfl/dotty/issues/6114
757-
{
758-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
759-
es.lastIndexOfSlice(Array("one", "two")) shouldBe 0
760-
es.lastIndexOfSlice(Array("ONE", "TWO")) shouldBe -1
761-
}
751+
implicit val strEq = StringNormalizations.lowerCased.toEquality
752+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
753+
es.lastIndexOfSlice(Array("one", "two")) shouldBe 0
754+
es.lastIndexOfSlice(Array("ONE", "TWO")) shouldBe -1
762755
// SKIP-DOTTY-END
763756
}
764757
it should "have 2 lastIndexOfSlice methods that take an Every" in {
@@ -778,11 +771,10 @@ class NonEmptyArraySpec extends UnitSpec {
778771
es.lastIndexOfSlice(Every("ONE", "TWO")) shouldBe -1
779772
// SKIP-DOTTY-START
780773
// https://github.com/lampepfl/dotty/issues/6114
781-
{
782-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
783-
es.lastIndexOfSlice(Every("one", "two")) shouldBe 0
784-
es.lastIndexOfSlice(Every("ONE", "TWO")) shouldBe -1
785-
}
774+
implicit val strEq = StringNormalizations.lowerCased.toEquality
775+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
776+
es.lastIndexOfSlice(Every("one", "two")) shouldBe 0
777+
es.lastIndexOfSlice(Every("ONE", "TWO")) shouldBe -1
786778
// SKIP-DOTTY-END
787779
}
788780
it should "have 2 lastIndexOfSlice methods that take a NonEmptyArray" in {
@@ -802,11 +794,10 @@ class NonEmptyArraySpec extends UnitSpec {
802794
es.lastIndexOfSlice(NonEmptyArray("ONE", "TWO")) shouldBe -1
803795
// SKIP-DOTTY-START
804796
// https://github.com/lampepfl/dotty/issues/6114
805-
{
806-
implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
807-
es.lastIndexOfSlice(NonEmptyArray("one", "two")) shouldBe 0
808-
es.lastIndexOfSlice(NonEmptyArray("ONE", "TWO")) shouldBe -1
809-
}
797+
implicit val strEq = StringNormalizations.lowerCased.toEquality
798+
//DOTTY-ONLY implicit val strEq: NormalizingEquality[String] = StringNormalizations.lowerCased.toEquality
799+
es.lastIndexOfSlice(NonEmptyArray("one", "two")) shouldBe 0
800+
es.lastIndexOfSlice(NonEmptyArray("ONE", "TWO")) shouldBe -1
810801
// SKIP-DOTTY-END
811802
}
812803
it should "have 2 lastIndexWhere methods" in {

0 commit comments

Comments
 (0)