@@ -22,7 +22,7 @@ class TestCodableSuper { }
22
22
#endif
23
23
24
24
// MARK: - Helper Functions
25
- @available ( OSX 10 . 11 , iOS 9 . 0 , * )
25
+ @available ( macOS 10 . 11 , iOS 9 . 0 , watchOS 2 . 0 , tvOS 9 . 0 , * )
26
26
func makePersonNameComponents( namePrefix: String ? = nil ,
27
27
givenName: String ? = nil ,
28
28
middleName: String ? = nil ,
@@ -220,7 +220,7 @@ class TestCodable : TestCodableSuper {
220
220
#line : CGAffineTransform ( a: 0.498 , b: - 0.284 , c: - 0.742 , d: 0.3248 , tx: 12 , ty: 44 )
221
221
]
222
222
223
- if #available( OSX 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
223
+ if #available( macOS 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
224
224
values [ #line] = CGAffineTransform ( rotationAngle: . pi / 2 )
225
225
}
226
226
@@ -246,7 +246,7 @@ class TestCodable : TestCodableSuper {
246
246
#line : CGPoint ( x: 10 , y: 20 )
247
247
]
248
248
249
- if #available( OSX 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
249
+ if #available( macOS 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
250
250
// Limit on magnitude in JSON. See rdar://problem/12717407
251
251
values [ #line] = CGPoint ( x: CGFloat . greatestFiniteMagnitude,
252
252
y: CGFloat . greatestFiniteMagnitude)
@@ -274,7 +274,7 @@ class TestCodable : TestCodableSuper {
274
274
#line : CGSize ( width: 30 , height: 40 )
275
275
]
276
276
277
- if #available( OSX 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
277
+ if #available( macOS 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
278
278
// Limit on magnitude in JSON. See rdar://problem/12717407
279
279
values [ #line] = CGSize ( width: CGFloat . greatestFiniteMagnitude,
280
280
height: CGFloat . greatestFiniteMagnitude)
@@ -303,7 +303,7 @@ class TestCodable : TestCodableSuper {
303
303
#line : CGRect ( x: 10 , y: 20 , width: 30 , height: 40 )
304
304
]
305
305
306
- if #available( OSX 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
306
+ if #available( macOS 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
307
307
// Limit on magnitude in JSON. See rdar://problem/12717407
308
308
values [ #line] = CGRect . infinite
309
309
}
@@ -330,7 +330,7 @@ class TestCodable : TestCodableSuper {
330
330
#line : CGVector ( dx: 0.0 , dy: - 9.81 )
331
331
]
332
332
333
- if #available( OSX 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
333
+ if #available( macOS 10 . 13 , iOS 11 . 0 , watchOS 4 . 0 , tvOS 11 . 0 , * ) {
334
334
// Limit on magnitude in JSON. See rdar://problem/12717407
335
335
values [ #line] = CGVector ( dx: CGFloat . greatestFiniteMagnitude,
336
336
dy: CGFloat . greatestFiniteMagnitude)
@@ -371,22 +371,22 @@ class TestCodable : TestCodableSuper {
371
371
}
372
372
373
373
// MARK: - DateInterval
374
- @available ( OSX 10 . 12 , iOS 10 . 10 , watchOS 3 . 0 , tvOS 10 . 0 , * )
374
+ @available ( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
375
375
lazy var dateIntervalValues : [ Int : DateInterval ] = [
376
376
#line : DateInterval ( ) ,
377
377
#line : DateInterval ( start: Date . distantPast, end: Date ( ) ) ,
378
378
#line : DateInterval ( start: Date ( ) , end: Date . distantFuture) ,
379
379
#line : DateInterval ( start: Date . distantPast, end: Date . distantFuture)
380
380
]
381
381
382
- @available ( OSX 10 . 12 , iOS 10 . 10 , watchOS 3 . 0 , tvOS 10 . 0 , * )
382
+ @available ( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
383
383
func test_DateInterval_JSON( ) {
384
384
for (testLine, interval) in dateIntervalValues {
385
385
expectRoundTripEqualityThroughJSON ( for: interval, lineNumber: testLine)
386
386
}
387
387
}
388
388
389
- @available ( OSX 10 . 12 , iOS 10 . 10 , watchOS 3 . 0 , tvOS 10 . 0 , * )
389
+ @available ( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
390
390
func test_DateInterval_Plist( ) {
391
391
for (testLine, interval) in dateIntervalValues {
392
392
expectRoundTripEqualityThroughPlist ( for: interval, lineNumber: testLine)
@@ -482,21 +482,21 @@ class TestCodable : TestCodableSuper {
482
482
}
483
483
484
484
// MARK: - Measurement
485
- @available ( OSX 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
485
+ @available ( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
486
486
lazy var unitValues : [ Int : Dimension ] = [
487
487
#line : UnitAcceleration . metersPerSecondSquared,
488
488
#line : UnitMass . kilograms,
489
489
#line : UnitLength . miles
490
490
]
491
491
492
- @available ( OSX 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
492
+ @available ( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
493
493
func test_Measurement_JSON( ) {
494
494
for (testLine, unit) in unitValues {
495
495
expectRoundTripEqualityThroughJSON ( for: Measurement ( value: 42 , unit: unit) , lineNumber: testLine)
496
496
}
497
497
}
498
498
499
- @available ( OSX 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
499
+ @available ( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * )
500
500
func test_Measurement_Plist( ) {
501
501
for (testLine, unit) in unitValues {
502
502
expectRoundTripEqualityThroughJSON ( for: Measurement ( value: 42 , unit: unit) , lineNumber: testLine)
@@ -523,21 +523,21 @@ class TestCodable : TestCodableSuper {
523
523
}
524
524
525
525
// MARK: - PersonNameComponents
526
- @available ( OSX 10 . 11 , iOS 9 . 0 , * )
526
+ @available ( macOS 10 . 11 , iOS 9 . 0 , watchOS 2 . 0 , tvOS 9 . 0 , * )
527
527
lazy var personNameComponentsValues : [ Int : PersonNameComponents ] = [
528
528
#line : makePersonNameComponents ( givenName: " John " , familyName: " Appleseed " ) ,
529
529
#line : makePersonNameComponents ( givenName: " John " , familyName: " Appleseed " , nickname: " Johnny " ) ,
530
530
#line : makePersonNameComponents ( namePrefix: " Dr. " , givenName: " Jane " , middleName: " A. " , familyName: " Appleseed " , nameSuffix: " Esq. " , nickname: " Janie " )
531
531
]
532
532
533
- @available ( OSX 10 . 11 , iOS 9 . 0 , * )
533
+ @available ( macOS 10 . 11 , iOS 9 . 0 , watchOS 2 . 0 , tvOS 9 . 0 , * )
534
534
func test_PersonNameComponents_JSON( ) {
535
535
for (testLine, components) in personNameComponentsValues {
536
536
expectRoundTripEqualityThroughJSON ( for: components, lineNumber: testLine)
537
537
}
538
538
}
539
539
540
- @available ( OSX 10 . 11 , iOS 9 . 0 , * )
540
+ @available ( macOS 10 . 11 , iOS 9 . 0 , watchOS 2 . 0 , tvOS 9 . 0 , * )
541
541
func test_PersonNameComponents_Plist( ) {
542
542
for (testLine, components) in personNameComponentsValues {
543
543
expectRoundTripEqualityThroughPlist ( for: components, lineNumber: testLine)
@@ -572,7 +572,7 @@ class TestCodable : TestCodableSuper {
572
572
#line : URL ( string: " documentation " , relativeTo: URL ( string: " http://swift.org " ) !) !
573
573
]
574
574
575
- if #available( OSX 10 . 11 , iOS 9 . 0 , * ) {
575
+ if #available( macOS 10 . 11 , iOS 9 . 0 , watchOS 2 . 0 , tvOS 9 . 0 , * ) {
576
576
values [ #line] = URL ( fileURLWithPath: " bin/sh " , relativeTo: URL ( fileURLWithPath: " / " ) )
577
577
}
578
578
@@ -770,8 +770,6 @@ var tests = [
770
770
" test_TimeZone_Plist " : TestCodable . test_TimeZone_Plist,
771
771
" test_URL_JSON " : TestCodable . test_URL_JSON,
772
772
" test_URL_Plist " : TestCodable . test_URL_Plist,
773
- " test_URLComponents_JSON " : TestCodable . test_URLComponents_JSON,
774
- " test_URLComponents_Plist " : TestCodable . test_URLComponents_Plist,
775
773
" test_UUID_JSON " : TestCodable . test_UUID_JSON,
776
774
" test_UUID_Plist " : TestCodable . test_UUID_Plist,
777
775
]
@@ -781,18 +779,23 @@ var tests = [
781
779
tests [ " test_AffineTransform_Plist " ] = TestCodable . test_AffineTransform_Plist
782
780
#endif
783
781
784
- if #available( OSX 10 . 11 , iOS 9 . 0 , * ) {
782
+ if #available( macOS 10 . 11 , iOS 9 . 0 , watchOS 2 . 0 , tvOS 9 . 0 , * ) {
785
783
tests [ " test_PersonNameComponents_JSON " ] = TestCodable . test_PersonNameComponents_JSON
786
784
tests [ " test_PersonNameComponents_Plist " ] = TestCodable . test_PersonNameComponents_Plist
787
785
}
788
786
789
- if #available( OSX 10 . 12 , iOS 10 . 10 , watchOS 3 . 0 , tvOS 10 . 0 , * ) {
787
+ if #available( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * ) {
790
788
// tests["test_DateInterval_JSON"] = TestCodable.test_DateInterval_JSON
791
789
tests [ " test_DateInterval_Plist " ] = TestCodable . test_DateInterval_Plist
792
790
// tests["test_Measurement_JSON"] = TestCodable.test_Measurement_JSON
793
791
// tests["test_Measurement_Plist"] = TestCodable.test_Measurement_Plist
794
792
}
795
793
794
+ if #available( macOS 10 . 12 , iOS 10 . 0 , watchOS 3 . 0 , tvOS 10 . 0 , * ) {
795
+ tests [ " test_URLComponents_JSON " ] = TestCodable . test_URLComponents_JSON
796
+ tests [ " test_URLComponents_Plist " ] = TestCodable . test_URLComponents_Plist
797
+ }
798
+
796
799
var CodableTests = TestSuite ( " TestCodable " )
797
800
for (name, test) in tests {
798
801
CodableTests . test ( name) { test ( TestCodable ( ) ) ( ) }
0 commit comments