@@ -442,19 +442,30 @@ class TestCodable : TestCodableSuper {
442
442
lazy var indexSetValues : [ Int : IndexSet ] = [
443
443
#line : IndexSet ( ) ,
444
444
#line : IndexSet ( integer: 42 ) ,
445
+ ]
446
+ lazy var indexSetMaxValues : [ Int : IndexSet ] = [
445
447
#line : IndexSet ( integersIn: 0 ..< Int . max)
446
448
]
447
449
448
450
func test_IndexSet_JSON( ) {
449
451
for (testLine, indexSet) in indexSetValues {
450
452
expectRoundTripEqualityThroughJSON ( for: indexSet, lineNumber: testLine)
451
453
}
454
+ if #available( macOS 10 . 10 , iOS 8 , * ) {
455
+ // Mac OS X 10.9 and iOS 7 weren't able to round-trip Int.max in JSON.
456
+ for (testLine, indexSet) in indexSetMaxValues {
457
+ expectRoundTripEqualityThroughJSON ( for: indexSet, lineNumber: testLine)
458
+ }
459
+ }
452
460
}
453
461
454
462
func test_IndexSet_Plist( ) {
455
463
for (testLine, indexSet) in indexSetValues {
456
464
expectRoundTripEqualityThroughPlist ( for: indexSet, lineNumber: testLine)
457
465
}
466
+ for (testLine, indexSet) in indexSetMaxValues {
467
+ expectRoundTripEqualityThroughPlist ( for: indexSet, lineNumber: testLine)
468
+ }
458
469
}
459
470
460
471
// MARK: - Locale
@@ -506,6 +517,9 @@ class TestCodable : TestCodableSuper {
506
517
// MARK: - NSRange
507
518
lazy var nsrangeValues : [ Int : NSRange ] = [
508
519
#line : NSRange ( ) ,
520
+ #line : NSRange ( location: 5 , length: 20 ) ,
521
+ ]
522
+ lazy var nsrangeMaxValues : [ Int : NSRange ] = [
509
523
#line : NSRange ( location: 0 , length: Int . max) ,
510
524
#line : NSRange ( location: NSNotFound, length: 0 ) ,
511
525
]
@@ -514,12 +528,21 @@ class TestCodable : TestCodableSuper {
514
528
for (testLine, range) in nsrangeValues {
515
529
expectRoundTripEqualityThroughJSON ( for: range, lineNumber: testLine)
516
530
}
531
+ if #available( macOS 10 . 10 , iOS 8 , * ) {
532
+ // Mac OS X 10.9 and iOS 7 weren't able to round-trip Int.max in JSON.
533
+ for (testLine, range) in nsrangeMaxValues {
534
+ expectRoundTripEqualityThroughJSON ( for: range, lineNumber: testLine)
535
+ }
536
+ }
517
537
}
518
538
519
539
func test_NSRange_Plist( ) {
520
540
for (testLine, range) in nsrangeValues {
521
541
expectRoundTripEqualityThroughPlist ( for: range, lineNumber: testLine)
522
542
}
543
+ for (testLine, range) in nsrangeMaxValues {
544
+ expectRoundTripEqualityThroughPlist ( for: range, lineNumber: testLine)
545
+ }
523
546
}
524
547
525
548
// MARK: - PersonNameComponents
0 commit comments