@@ -1983,7 +1983,8 @@ SetTestSuite.test("BridgedFromObjC.Verbatim.RemoveAll") {
1983
1983
}
1984
1984
1985
1985
SetTestSuite . test ( " BridgedFromObjC.Nonverbatim.RemoveAll " ) {
1986
- do {
1986
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
1987
+ // Identity of empty sets changed in https://github.com/apple/swift/pull/22527
1987
1988
var s = getBridgedNonverbatimSet ( [ ] )
1988
1989
expectTrue ( isNativeSet ( s) )
1989
1990
expectEqual ( 0 , s. count)
@@ -2174,6 +2175,10 @@ SetTestSuite.test("BridgedFromObjC.Verbatim.EqualityTest_Empty") {
2174
2175
}
2175
2176
2176
2177
SetTestSuite . test ( " BridgedFromObjC.Nonverbatim.EqualityTest_Empty " ) {
2178
+ guard #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) else {
2179
+ // Identity of empty sets changed in https://github.com/apple/swift/pull/22527
2180
+ return
2181
+ }
2177
2182
let s1 = getBridgedNonverbatimSet ( [ ] )
2178
2183
let identity1 = s1. _rawIdentifier ( )
2179
2184
expectTrue ( isNativeSet ( s1) )
@@ -4617,45 +4622,49 @@ SetTestSuite.test("IndexValidation.RemoveAt.AfterGrow") {
4617
4622
}
4618
4623
4619
4624
#if _runtime(_ObjC)
4620
- SetTestSuite . test ( " ForcedNonverbatimBridge.Trap.String " )
4625
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
4626
+ // https://github.com/apple/swift/pull/23174
4627
+ SetTestSuite . test ( " ForcedNonverbatimBridge.Trap.String " )
4621
4628
. skip ( . custom(
4622
- { _isFastAssertConfiguration ( ) } ,
4623
- reason: " this trap is not guaranteed to happen in -Ounchecked " ) )
4629
+ { _isFastAssertConfiguration ( ) } ,
4630
+ reason: " this trap is not guaranteed to happen in -Ounchecked " ) )
4624
4631
. crashOutputMatches ( " Could not cast value of type " )
4625
4632
. code {
4633
+ let s1 : NSSet = [
4634
+ " Gordon " as NSString ,
4635
+ " William " as NSString ,
4636
+ " Katherine " as NSString ,
4637
+ " Lynn " as NSString ,
4638
+ " Brian " as NSString ,
4639
+ 1756 as NSNumber ]
4626
4640
4627
- let s1 : NSSet = [
4628
- " Gordon " as NSString ,
4629
- " William " as NSString ,
4630
- " Katherine " as NSString ,
4631
- " Lynn " as NSString ,
4632
- " Brian " as NSString ,
4633
- 1756 as NSNumber ]
4634
-
4635
- expectCrashLater ( )
4636
- _ = s1 as! Set < String >
4641
+ expectCrashLater ( )
4642
+ _ = s1 as! Set < String >
4643
+ }
4637
4644
}
4638
4645
#endif
4639
4646
4640
4647
#if _runtime(_ObjC)
4641
- SetTestSuite . test ( " ForcedNonverbatimBridge.Trap.Int " )
4648
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
4649
+ // https://github.com/apple/swift/pull/23174
4650
+ SetTestSuite . test ( " ForcedNonverbatimBridge.Trap.Int " )
4642
4651
. skip ( . custom(
4643
4652
{ _isFastAssertConfiguration ( ) } ,
4644
4653
reason: " this trap is not guaranteed to happen in -Ounchecked " ) )
4645
4654
. crashOutputMatches ( " Could not cast value of type " )
4646
4655
. code {
4656
+ let s1 : NSSet = [
4657
+ 4 as NSNumber ,
4658
+ 8 as NSNumber ,
4659
+ 15 as NSNumber ,
4660
+ 16 as NSNumber ,
4661
+ 23 as NSNumber ,
4662
+ 42 as NSNumber ,
4663
+ " John " as NSString ]
4647
4664
4648
- let s1 : NSSet = [
4649
- 4 as NSNumber ,
4650
- 8 as NSNumber ,
4651
- 15 as NSNumber ,
4652
- 16 as NSNumber ,
4653
- 23 as NSNumber ,
4654
- 42 as NSNumber ,
4655
- " John " as NSString ]
4656
-
4657
- expectCrashLater ( )
4658
- _ = s1 as! Set < Int >
4665
+ expectCrashLater ( )
4666
+ _ = s1 as! Set < Int >
4667
+ }
4659
4668
}
4660
4669
#endif
4661
4670
@@ -4768,61 +4777,70 @@ SetTestSuite.test("ForcedVerbatimDowncast.Trap.Int")
4768
4777
#endif
4769
4778
4770
4779
#if _runtime(_ObjC)
4771
- SetTestSuite . test ( " ForcedBridgingNonverbatimDowncast.Trap.String " )
4780
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
4781
+ // https://github.com/apple/swift/pull/23174
4782
+ SetTestSuite . test ( " ForcedBridgingNonverbatimDowncast.Trap.String " )
4772
4783
. skip ( . custom(
4773
4784
{ _isFastAssertConfiguration ( ) } ,
4774
4785
reason: " this trap is not guaranteed to happen in -Ounchecked " ) )
4775
4786
. crashOutputMatches ( " Could not cast value of type " )
4776
4787
. code {
4777
- let s1 : Set < NSObject > = [
4778
- " Gordon " as NSString ,
4779
- " William " as NSString ,
4780
- " Katherine " as NSString ,
4781
- " Lynn " as NSString ,
4782
- " Brian " as NSString ,
4783
- 1756 as NSNumber ]
4784
- expectCrashLater ( )
4785
- // Nonverbatim downcasts are greedy and they trap immediately.
4786
- let s2 = s1 as! Set < String >
4787
- _ = s2. contains ( " Gordon " )
4788
+ let s1 : Set < NSObject > = [
4789
+ " Gordon " as NSString ,
4790
+ " William " as NSString ,
4791
+ " Katherine " as NSString ,
4792
+ " Lynn " as NSString ,
4793
+ " Brian " as NSString ,
4794
+ 1756 as NSNumber ]
4795
+ expectCrashLater ( )
4796
+ // Nonverbatim downcasts are greedy and they trap immediately.
4797
+ let s2 = s1 as! Set < String >
4798
+ _ = s2. contains ( " Gordon " )
4799
+ }
4788
4800
}
4789
4801
#endif
4790
4802
4791
4803
#if _runtime(_ObjC)
4792
- SetTestSuite . test ( " ForcedBridgingNonverbatimDowncast.Trap.Int " )
4804
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
4805
+ // https://github.com/apple/swift/pull/23174
4806
+ SetTestSuite . test ( " ForcedBridgingNonverbatimDowncast.Trap.Int " )
4793
4807
. skip ( . custom(
4794
4808
{ _isFastAssertConfiguration ( ) } ,
4795
4809
reason: " this trap is not guaranteed to happen in -Ounchecked " ) )
4796
4810
. crashOutputMatches ( " Could not cast value of type " )
4797
4811
. code {
4798
- let s1 : Set < NSObject > = [
4799
- 4 as NSNumber ,
4800
- 8 as NSNumber ,
4801
- 15 as NSNumber ,
4802
- 16 as NSNumber ,
4803
- 23 as NSNumber ,
4804
- 42 as NSNumber ,
4805
- " John " as NSString ]
4806
- expectCrashLater ( )
4807
- // Nonverbatim downcasts are greedy and they trap immediately.
4808
- let s2 = s1 as! Set < Int >
4809
- _ = s2. contains ( 23 )
4812
+ let s1 : Set < NSObject > = [
4813
+ 4 as NSNumber ,
4814
+ 8 as NSNumber ,
4815
+ 15 as NSNumber ,
4816
+ 16 as NSNumber ,
4817
+ 23 as NSNumber ,
4818
+ 42 as NSNumber ,
4819
+ " John " as NSString ]
4820
+ expectCrashLater ( )
4821
+ // Nonverbatim downcasts are greedy and they trap immediately.
4822
+ let s2 = s1 as! Set < Int >
4823
+ _ = s2. contains ( 23 )
4824
+ }
4810
4825
}
4811
4826
#endif
4812
4827
4813
4828
#if _runtime(_ObjC)
4814
- SetTestSuite . test ( " Upcast.StringEqualityMismatch " ) {
4815
- // Upcasting from NSString to String keys changes their concept of equality,
4816
- // resulting in two equal keys, one of which should be discarded by the
4817
- // downcast. (Along with its associated value.)
4818
- // rdar://problem/35995647
4819
- let s : Set < NSString > = [
4820
- " cafe \u{301} " ,
4821
- " café "
4822
- ]
4823
- expectEqual ( s. count, 2 )
4824
- let s2 = s as Set < String >
4825
- expectEqual ( s2. count, 1 )
4829
+ if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
4830
+ // https://github.com/apple/swift/pull/23683
4831
+ SetTestSuite . test ( " Upcast.StringEqualityMismatch " ) {
4832
+ // Upcasting from NSString to String keys changes their concept of equality,
4833
+ // resulting in two equal keys, one of which should be discarded by the
4834
+ // downcast. (Along with its associated value.)
4835
+ // rdar://problem/35995647
4836
+ let s : Set < NSString > = [
4837
+ " cafe \u{301} " ,
4838
+ " café "
4839
+ ]
4840
+ expectEqual ( s. count, 2 )
4841
+ let s2 = s as Set < String >
4842
+ expectEqual ( s2. count, 1 )
4843
+ }
4826
4844
}
4827
4845
#endif
4828
4846
0 commit comments