Skip to content
Snippets Groups Projects
Commit 39909b36 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Fix crash "call to deleted method" when running tests on Xcode 14

parent bfed247a
No related branches found
No related tags found
1 merge request!102Release 1.0.0
......@@ -8,14 +8,14 @@ class JSONDecoder: Foundation.JSONDecoder {
override func decode<T>(_ type: T.Type, from data: Data) throws -> T where T: Decodable {
do {
let data = convertNumberToString(in: data, at: "Value")
let data = Self.convertNumberToString(in: data, at: "Value")
return try super.decode(type, from: data)
} catch {
throw JSONDecodingError(error, data: data)
}
}
func convertNumberToString(
static func convertNumberToString(
in input: Data,
at key: String
) -> Data {
......
......@@ -9,14 +9,14 @@ class JSONEncoder: Foundation.JSONEncoder {
override func encode<T>(_ value: T) throws -> Data where T: Encodable {
do {
var data = try super.encode(value)
data = convertStringToNumber(in: data, at: "Value")
data = Self.convertStringToNumber(in: data, at: "Value")
return data
} catch {
throw JSONEncodingError(error, value: value)
}
}
func convertStringToNumber(
static func convertStringToNumber(
in input: Data,
at key: String
) -> Data {
......
......@@ -71,7 +71,7 @@ private func assertConvertingNumberToString(
) {
XCTAssertNoDifference(
String(
data: JSONDecoder().convertNumberToString(
data: JSONDecoder.convertNumberToString(
in: input.data(using: .utf8)!,
at: key
),
......
......@@ -71,7 +71,7 @@ private func assertConvertingStringToNumber(
) {
XCTAssertNoDifference(
String(
data: JSONEncoder().convertStringToNumber(
data: JSONEncoder.convertStringToNumber(
in: input.data(using: .utf8)!,
at: key
),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment