@@ -442,19 +442,30 @@ class TestCodable : TestCodableSuper {
442442 lazy var indexSetValues : [ Int : IndexSet ] = [
443443 #line : IndexSet ( ) ,
444444 #line : IndexSet ( integer: 42 ) ,
445+ ]
446+ lazy var indexSetMaxValues : [ Int : IndexSet ] = [
445447 #line : IndexSet ( integersIn: 0 ..< Int . max)
446448 ]
447449
448450 func test_IndexSet_JSON( ) {
449451 for (testLine, indexSet) in indexSetValues {
450452 expectRoundTripEqualityThroughJSON ( for: indexSet, lineNumber: testLine)
451453 }
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+ }
452460 }
453461
454462 func test_IndexSet_Plist( ) {
455463 for (testLine, indexSet) in indexSetValues {
456464 expectRoundTripEqualityThroughPlist ( for: indexSet, lineNumber: testLine)
457465 }
466+ for (testLine, indexSet) in indexSetMaxValues {
467+ expectRoundTripEqualityThroughPlist ( for: indexSet, lineNumber: testLine)
468+ }
458469 }
459470
460471 // MARK: - Locale
@@ -506,6 +517,9 @@ class TestCodable : TestCodableSuper {
506517 // MARK: - NSRange
507518 lazy var nsrangeValues : [ Int : NSRange ] = [
508519 #line : NSRange ( ) ,
520+ #line : NSRange ( location: 5 , length: 20 ) ,
521+ ]
522+ lazy var nsrangeMaxValues : [ Int : NSRange ] = [
509523 #line : NSRange ( location: 0 , length: Int . max) ,
510524 #line : NSRange ( location: NSNotFound, length: 0 ) ,
511525 ]
@@ -514,12 +528,21 @@ class TestCodable : TestCodableSuper {
514528 for (testLine, range) in nsrangeValues {
515529 expectRoundTripEqualityThroughJSON ( for: range, lineNumber: testLine)
516530 }
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+ }
517537 }
518538
519539 func test_NSRange_Plist( ) {
520540 for (testLine, range) in nsrangeValues {
521541 expectRoundTripEqualityThroughPlist ( for: range, lineNumber: testLine)
522542 }
543+ for (testLine, range) in nsrangeMaxValues {
544+ expectRoundTripEqualityThroughPlist ( for: range, lineNumber: testLine)
545+ }
523546 }
524547
525548 // MARK: - PersonNameComponents
0 commit comments