diff --git a/Sources/DeviceModel.swift b/Sources/DeviceModel.swift index ab863d3..ca0698e 100644 --- a/Sources/DeviceModel.swift +++ b/Sources/DeviceModel.swift @@ -161,7 +161,7 @@ extension DeviceModel { case (5, 3), (5, 4): return .iPadAir2 case (11, 3), (11, 4): return .iPadAir3 case (13, 1), (13, 2): return .iPadAir4 - case (13, 17), (13, 18): return .iPadAir5 + case (13, 16), (13, 17): return .iPadAir5 case (2, 5), (2, 6), (2, 7): return .iPadMini case (4, 4), (4, 5), (4, 6): return .iPadMini2 case (4, 7), (4, 8), (4, 9): return .iPadMini3 diff --git a/Sources/Identifier.swift b/Sources/Identifier.swift index 1bd7541..d388549 100644 --- a/Sources/Identifier.swift +++ b/Sources/Identifier.swift @@ -167,7 +167,7 @@ extension Identifier: CustomStringConvertible { case (14, 5): return "iPhone 13" case (14, 6): - return "iPhone SE (3nd Gen)" + return "iPhone SE (3rd Gen)" default: return "unknown" @@ -315,10 +315,10 @@ extension Identifier: CustomStringConvertible { return "3rd Gen iPad Air (Wi-Fi+LTE)" case (13, 1): return "4th Gen iPad Air (Wi-Fi)" - case (13, 17): + case (13, 16): return "5th Gen iPad Air (Wi-Fi)" - case (13, 18): - return "5th Gen iPad Air (Wi-Fi+LTE)" + case (13, 17): + return "5th Gen iPad Air (Wi-Fi+5G)" case (13, 2): return "4th Gen iPad Air (Wi-Fi+LTE)" case (11, 6): diff --git a/Tests/DeviceModelTests.swift b/Tests/DeviceModelTests.swift index 42e432e..b1c7b17 100644 --- a/Tests/DeviceModelTests.swift +++ b/Tests/DeviceModelTests.swift @@ -192,6 +192,11 @@ class DeviceModelTests: XCTestCase { } func testDeviceModelIPhone13ProMax() { + let deviceModel = DeviceModel(identifier: Identifier("iPhone14,6")) + XCTAssert(deviceModel == .iPhoneSE3 , "DeviceModel - .iPhoneSE3 is failing") + } + + func testDeviceModelIPhoneSE3() { let deviceModel = DeviceModel(identifier: Identifier("iPhone14,3")) XCTAssert(deviceModel == .iPhone13ProMax , "DeviceModel - .iPhone13ProMax is failing") } @@ -392,6 +397,12 @@ class DeviceModelTests: XCTestCase { XCTAssert(deviceModel1 == .iPadAir3 && deviceModel2 == .iPadAir3 , "DeviceModel - .iPadAir3 is failing") } + func testDeviceModelIPadAir5() { + let deviceModel1 = DeviceModel(identifier: Identifier("iPad13,16")) + let deviceModel2 = DeviceModel(identifier: Identifier("iPad13,17")) + XCTAssert(deviceModel1 == .iPadAir5 && deviceModel2 == .iPadAir5 , "DeviceModel - .iPadAir5 is failing") + } + // MARK: - iPod Device Model tests func testDeviceModelIPodTouchFirstGen() { diff --git a/Tests/IdentifierTests.swift b/Tests/IdentifierTests.swift index 3dddaad..5ab9262 100644 --- a/Tests/IdentifierTests.swift +++ b/Tests/IdentifierTests.swift @@ -66,6 +66,10 @@ class IdentifierTests: XCTestCase { // MARK: - iPhone String Description tests + func testDisplayStringiPhone14v6() { + XCTAssert(Identifier("iPhone14,6").description == "iPhone SE (3rd Gen)", "iPhone14,6 is failing to produce a common device model string") + } + func testDisplayStringiPhone14v5() { XCTAssert(Identifier("iPhone14,5").description == "iPhone 13", "iPhone14,5 is failing to produce a common device model string") } @@ -286,6 +290,14 @@ class IdentifierTests: XCTestCase { func testDisplayStringiPad14v1() { XCTAssert(Identifier("iPad14,1").description == "6th Gen iPad mini (8.3 inch, Wi-Fi)", "iPad14,1 is failing to produce a common device model string") } + + func testDisplayStringiPad13v16() { + XCTAssert(Identifier("iPad13,16").description == "5th Gen iPad Air (Wi-Fi)", "iPad13,16 is failing to produce a common device model string") + } + func testDisplayStringiPad13v17() { + XCTAssert(Identifier("iPad13,17").description == "5th Gen iPad Air (Wi-Fi+5G)", "iPad13,17 is failing to produce a common device model string") + } + func testDisplayStringiPad13v11() { XCTAssert(Identifier("iPad13,11").description == "5th Gen iPad Pro (12.9 inch, Wi-Fi+5G, 16GB RAM)", "iPad13,11 is failing to produce a common device model string") }