@@ -611,87 +611,87 @@ class ShouldContainElementSpec extends FunSpec with PropertyChecks with ReturnsN
611
611
val caught = intercept[TestFailedException ] {
612
612
HashSet (1 , 2 ) should contain (3 )
613
613
}
614
- assert(caught.getMessage === " Set (1, 2) did not contain element 3" )
614
+ assert(caught.getMessage === HashSet (1 , 2 ) + " did not contain element 3" )
615
615
}
616
616
617
617
it(" should throw TestFailedException if set contains the specified element, when used with not" ) {
618
618
619
619
val caught1 = intercept[TestFailedException ] {
620
620
HashSet (1 , 2 ) should not contain (2 )
621
621
}
622
- assert(caught1.getMessage === " Set (1, 2) contained element 2" )
622
+ assert(caught1.getMessage === HashSet (1 , 2 ) + " contained element 2" )
623
623
624
624
val caught2 = intercept[TestFailedException ] {
625
625
HashSet (1 , 2 ) should not (contain (2 ))
626
626
}
627
- assert(caught2.getMessage === " Set (1, 2) contained element 2" )
627
+ assert(caught2.getMessage === HashSet (1 , 2 ) + " contained element 2" )
628
628
629
629
val caught3 = intercept[TestFailedException ] {
630
630
HashSet (1 , 2 ) should (not contain (2 ))
631
631
}
632
- assert(caught3.getMessage === " Set (1, 2) contained element 2" )
632
+ assert(caught3.getMessage === HashSet (1 , 2 ) + " contained element 2" )
633
633
}
634
634
635
635
it(" should throw a TestFailedException when set doesn't contain the specified element and used in a logical-and expression" ) {
636
636
637
637
val caught1 = intercept[TestFailedException ] {
638
638
HashSet (1 , 2 ) should { contain (5 ) and (contain (2 - 1 )) }
639
639
}
640
- assert(caught1.getMessage === " Set (1, 2) did not contain element 5" )
640
+ assert(caught1.getMessage === HashSet (1 , 2 ) + " did not contain element 5" )
641
641
642
642
val caught2 = intercept[TestFailedException ] {
643
643
HashSet (1 , 2 ) should (contain (5 ) and contain (2 - 1 ))
644
644
}
645
- assert(caught2.getMessage === " Set (1, 2) did not contain element 5" )
645
+ assert(caught2.getMessage === HashSet (1 , 2 ) + " did not contain element 5" )
646
646
}
647
647
648
648
it(" should throw a TestFailedException when set doesn't contain the specified element and used in a logical-or expression" ) {
649
649
650
650
val caught1 = intercept[TestFailedException ] {
651
651
HashSet (1 , 2 ) should { contain (55 ) or (contain (22 )) }
652
652
}
653
- assert(caught1.getMessage === " Set (1, 2) did not contain element 55, and Set (1, 2) did not contain element 22" )
653
+ assert(caught1.getMessage === HashSet (1 , 2 ) + " did not contain element 55, and " + HashSet (1 , 2 ) + " did not contain element 22" )
654
654
655
655
val caught2 = intercept[TestFailedException ] {
656
656
HashSet (1 , 2 ) should (contain (55 ) or contain (22 ))
657
657
}
658
- assert(caught2.getMessage === " Set (1, 2) did not contain element 55, and Set (1, 2) did not contain element 22" )
658
+ assert(caught2.getMessage === HashSet (1 , 2 ) + " did not contain element 55, and " + HashSet (1 , 2 ) + " did not contain element 22" )
659
659
}
660
660
661
661
it(" should throw a TestFailedException when set contains the specified element and used in a logical-and expression with not" ) {
662
662
663
663
val caught1 = intercept[TestFailedException ] {
664
664
HashSet (1 , 2 ) should { not { contain (3 ) } and not { contain (2 ) }}
665
665
}
666
- assert(caught1.getMessage === " Set (1, 2) did not contain element 3, but Set (1, 2) contained element 2" )
666
+ assert(caught1.getMessage === HashSet (1 , 2 ) + " did not contain element 3, but " + HashSet (1 , 2 ) + " contained element 2" )
667
667
668
668
val caught2 = intercept[TestFailedException ] {
669
669
HashSet (1 , 2 ) should ((not contain (3 )) and (not contain (2 )))
670
670
}
671
- assert(caught2.getMessage === " Set (1, 2) did not contain element 3, but Set (1, 2) contained element 2" )
671
+ assert(caught2.getMessage === HashSet (1 , 2 ) + " did not contain element 3, but " + HashSet (1 , 2 ) + " contained element 2" )
672
672
673
673
val caught3 = intercept[TestFailedException ] {
674
674
HashSet (1 , 2 ) should (not contain (3 ) and not contain (2 ))
675
675
}
676
- assert(caught3.getMessage === " Set (1, 2) did not contain element 3, but Set (1, 2) contained element 2" )
676
+ assert(caught3.getMessage === HashSet (1 , 2 ) + " did not contain element 3, but " + HashSet (1 , 2 ) + " contained element 2" )
677
677
}
678
678
679
679
it(" should throw a TestFailedException when set contains the specified element and used in a logical-or expression with not" ) {
680
680
681
681
val caught1 = intercept[TestFailedException ] {
682
682
HashSet (1 , 2 ) should { not { contain (2 ) } or not { contain (2 ) }}
683
683
}
684
- assert(caught1.getMessage === " Set (1, 2) contained element 2, and Set (1, 2) contained element 2" )
684
+ assert(caught1.getMessage === HashSet (1 , 2 ) + " contained element 2, and " + HashSet (1 , 2 ) + " contained element 2" )
685
685
686
686
val caught2 = intercept[TestFailedException ] {
687
687
HashSet (1 , 2 ) should ((not contain (2 )) or (not contain (2 )))
688
688
}
689
- assert(caught2.getMessage === " Set (1, 2) contained element 2, and Set (1, 2) contained element 2" )
689
+ assert(caught2.getMessage === HashSet (1 , 2 ) + " contained element 2, and " + HashSet (1 , 2 ) + " contained element 2" )
690
690
691
691
val caught3 = intercept[TestFailedException ] {
692
692
HashSet (1 , 2 ) should (not contain (2 ) or not contain (2 ))
693
693
}
694
- assert(caught3.getMessage === " Set (1, 2) contained element 2, and Set (1, 2) contained element 2" )
694
+ assert(caught3.getMessage === HashSet (1 , 2 ) + " contained element 2, and " + HashSet (1 , 2 ) + " contained element 2" )
695
695
}
696
696
697
697
// SKIP-SCALATESTJS,NATIVE-START
0 commit comments