@@ -202,7 +202,7 @@ StringTests.test("ForeignIndexes/subscript(Index)/OutOfBoundsTrap") {
202
202
203
203
let i = donor. index ( _nth: 3 )
204
204
expectCrashLater ( )
205
- acceptor [ i]
205
+ _ = acceptor [ i]
206
206
}
207
207
208
208
StringTests . test ( " String/subscript(_:Range) " ) {
@@ -229,7 +229,7 @@ StringTests.test("ForeignIndexes/subscript(Range)/OutOfBoundsTrap/1") {
229
229
230
230
let r = donor. startIndex..< donor. index ( _nth: 4 )
231
231
expectCrashLater ( )
232
- acceptor [ r]
232
+ _ = acceptor [ r]
233
233
}
234
234
235
235
StringTests . test ( " ForeignIndexes/subscript(Range)/OutOfBoundsTrap/2 " ) {
@@ -240,7 +240,7 @@ StringTests.test("ForeignIndexes/subscript(Range)/OutOfBoundsTrap/2") {
240
240
241
241
let r = donor. index ( _nth: 4 ) ..< donor. index ( _nth: 5 )
242
242
expectCrashLater ( )
243
- acceptor [ r]
243
+ _ = acceptor [ r]
244
244
}
245
245
246
246
StringTests . test ( " ForeignIndexes/replaceSubrange/OutOfBoundsTrap/1 " ) {
@@ -497,9 +497,7 @@ StringTests.test("COW/removeSubrange/start") {
497
497
498
498
// No more reallocations are expected.
499
499
str. removeSubrange ( str. startIndex..< str. index ( _nth: 1 ) )
500
- // FIXME: extra reallocation, should be expectEqual()
501
- expectNotEqual ( heapStrIdentity, str. bufferID)
502
- // end FIXME
500
+ expectEqual ( heapStrIdentity, str. bufferID)
503
501
expectEqual ( literalIdentity, slice. bufferID)
504
502
expectEqual ( " 345678 " , str)
505
503
expectEqual ( " 12345678 " , slice)
@@ -526,9 +524,7 @@ StringTests.test("COW/removeSubrange/start") {
526
524
527
525
// No more reallocations are expected.
528
526
str. removeSubrange ( str. startIndex..< str. index ( _nth: 1 ) )
529
- // FIXME: extra reallocation, should be expectEqual()
530
- expectNotEqual ( heapStrIdentity2, str. bufferID)
531
- // end FIXME
527
+ expectEqual ( heapStrIdentity2, str. bufferID)
532
528
expectEqual ( heapStrIdentity1, slice. bufferID)
533
529
expectEqual ( " 5678 " , str)
534
530
expectEqual ( " 345678 " , slice)
@@ -559,19 +555,15 @@ StringTests.test("COW/removeSubrange/end") {
559
555
// No more reallocations are expected.
560
556
str. append ( UnicodeScalar ( " x " ) )
561
557
str. removeSubrange ( str. index ( _nthLast: 1 ) ..< str. endIndex)
562
- // FIXME: extra reallocation, should be expectEqual()
563
- expectNotEqual ( heapStrIdentity, str. bufferID)
564
- // end FIXME
558
+ expectEqual ( heapStrIdentity, str. bufferID)
565
559
expectEqual ( literalIdentity, slice. bufferID)
566
560
expectEqual ( " 1234567 " , str)
567
561
expectEqual ( " 12345678 " , slice)
568
562
569
563
str. removeSubrange ( str. index ( _nthLast: 1 ) ..< str. endIndex)
570
564
str. append ( UnicodeScalar ( " x " ) )
571
565
str. removeSubrange ( str. index ( _nthLast: 1 ) ..< str. endIndex)
572
- // FIXME: extra reallocation, should be expectEqual()
573
- //expectNotEqual(heapStrIdentity, str.bufferID)
574
- // end FIXME
566
+ expectEqual ( heapStrIdentity, str. bufferID)
575
567
expectEqual ( literalIdentity, slice. bufferID)
576
568
expectEqual ( " 123456 " , str)
577
569
expectEqual ( " 12345678 " , slice)
@@ -599,19 +591,15 @@ StringTests.test("COW/removeSubrange/end") {
599
591
// No more reallocations are expected.
600
592
str. append ( UnicodeScalar ( " x " ) )
601
593
str. removeSubrange ( str. index ( _nthLast: 1 ) ..< str. endIndex)
602
- // FIXME: extra reallocation, should be expectEqual()
603
- expectNotEqual ( heapStrIdentity, str. bufferID)
604
- // end FIXME
594
+ expectEqual ( heapStrIdentity, str. bufferID)
605
595
expectEqual ( heapStrIdentity1, slice. bufferID)
606
596
expectEqual ( " 12345 " , str)
607
597
expectEqual ( " 123456 " , slice)
608
598
609
599
str. removeSubrange ( str. index ( _nthLast: 1 ) ..< str. endIndex)
610
600
str. append ( UnicodeScalar ( " x " ) )
611
601
str. removeSubrange ( str. index ( _nthLast: 1 ) ..< str. endIndex)
612
- // FIXME: extra reallocation, should be expectEqual()
613
- //expectNotEqual(heapStrIdentity, str.bufferID)
614
- // end FIXME
602
+ expectEqual ( heapStrIdentity, str. bufferID)
615
603
expectEqual ( heapStrIdentity1, slice. bufferID)
616
604
expectEqual ( " 1234 " , str)
617
605
expectEqual ( " 123456 " , slice)
@@ -634,16 +622,14 @@ StringTests.test("COW/replaceSubrange/end") {
634
622
slice. replaceSubrange ( slice. endIndex..< slice. endIndex, with: " a " )
635
623
expectNotEqual ( literalIdentity, slice. bufferID)
636
624
expectEqual ( literalIdentity, str. bufferID)
637
- let heapStrIdentity = str . bufferID
625
+ let heapStrIdentity = slice . bufferID
638
626
expectEqual ( " 1234567a " , slice)
639
627
expectEqual ( " 12345678 " , str)
640
628
641
629
// No more reallocations are expected.
642
630
slice. replaceSubrange (
643
631
slice. index ( _nthLast: 1 ) ..< slice. endIndex, with: " b " )
644
- // FIXME: extra reallocation, should be expectEqual()
645
- expectNotEqual ( heapStrIdentity, slice. bufferID)
646
- // end FIXME
632
+ expectEqual ( heapStrIdentity, slice. bufferID)
647
633
expectEqual ( literalIdentity, str. bufferID)
648
634
649
635
expectEqual ( " 1234567b " , slice)
@@ -675,9 +661,7 @@ StringTests.test("COW/replaceSubrange/end") {
675
661
// No more reallocations are expected.
676
662
slice. replaceSubrange (
677
663
slice. index ( _nthLast: 1 ) ..< slice. endIndex, with: " b " )
678
- // FIXME: extra reallocation, should be expectEqual()
679
- expectNotEqual ( heapStrIdentity2, slice. bufferID)
680
- // end FIXME
664
+ expectEqual ( heapStrIdentity2, slice. bufferID)
681
665
expectEqual ( heapStrIdentity1, str. bufferID)
682
666
683
667
expectEqual ( " 1234567b " , slice)
0 commit comments