From 59375d0451f59e79e1ab9e040c24f81edb59cb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pantale=C3=A3o=20Gon=C3=A7alves?= Date: Thu, 18 Apr 2024 14:52:23 +0200 Subject: [PATCH] Fix "(redundantInit) Remove explicit init if not required." --- Tests/HADataDecodable.test.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/HADataDecodable.test.swift b/Tests/HADataDecodable.test.swift index ab153cf..c295430 100644 --- a/Tests/HADataDecodable.test.swift +++ b/Tests/HADataDecodable.test.swift @@ -9,13 +9,13 @@ internal class HADataDecodableTests: XCTestCase { func testArrayDecodableSuccess() throws { let data = HAData.array([.empty, .empty, .empty]) - let result = try [RandomDecodable].init(data: data) + let result = try [RandomDecodable](data: data) XCTAssertEqual(result.count, 3) } func testArrayDecodableFailureDueToRootData() { let data = HAData.dictionary(["key": "value"]) - XCTAssertThrowsError(try [RandomDecodable].init(data: data)) { error in + XCTAssertThrowsError(try [RandomDecodable](data: data)) { error in XCTAssertEqual(error as? HADataError, .couldntTransform(key: "root")) } } @@ -23,7 +23,7 @@ internal class HADataDecodableTests: XCTestCase { func testArrayDecodableFailureDueToInside() throws { RandomDecodable.shouldThrow = true let data = HAData.array([.empty, .empty, .empty]) - XCTAssertThrowsError(try [RandomDecodable].init(data: data)) { error in + XCTAssertThrowsError(try [RandomDecodable](data: data)) { error in XCTAssertEqual(error as? HADataError, .missingKey("any")) } }