From d8b4b4078c7cdc635250a429b8a1cea74146f337 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Sun, 23 Jun 2024 22:42:02 -0700 Subject: [PATCH] dont test some tests on tvOS --- Sources/ParseSwift/Protocols/ParseTypeable.swift | 7 +++---- Tests/ParseSwiftTests/ParsePushPayloadAnyTests.swift | 4 ++-- Tests/ParseSwiftTests/ParsePushPayloadFirebaseTests.swift | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Sources/ParseSwift/Protocols/ParseTypeable.swift b/Sources/ParseSwift/Protocols/ParseTypeable.swift index 63f4e40cb..555049652 100644 --- a/Sources/ParseSwift/Protocols/ParseTypeable.swift +++ b/Sources/ParseSwift/Protocols/ParseTypeable.swift @@ -19,11 +19,10 @@ public protocol ParseTypeable: Codable, // MARK: CustomDebugStringConvertible extension ParseTypeable { public var debugDescription: String { - guard let descriptionData = try? ParseCoding.jsonEncoder().encode(self), - let descriptionString = String(data: descriptionData, encoding: .utf8) else { - return "()" + guard let descriptionData = try? ParseCoding.jsonEncoder().encode(self) else { + return "()" } - + let descriptionString = String(decoding: descriptionData, as: UTF8.self) return "\(descriptionString)" } } diff --git a/Tests/ParseSwiftTests/ParsePushPayloadAnyTests.swift b/Tests/ParseSwiftTests/ParsePushPayloadAnyTests.swift index 9a03432bf..0a96b0aa0 100644 --- a/Tests/ParseSwiftTests/ParsePushPayloadAnyTests.swift +++ b/Tests/ParseSwiftTests/ParsePushPayloadAnyTests.swift @@ -113,7 +113,7 @@ class ParsePushPayloadAnyTests: XCTestCase { XCTAssertEqual(fcmPayload, decoded2) let decodedAny2 = try ParseCoding.jsonDecoder().decode(ParsePushPayloadAny.self, from: encoded).convertToApple() XCTAssertEqual(decodedAny2, applePayload) - #if !os(Linux) && !os(Android) && !os(Windows) + #if !os(Linux) && !os(Android) && !os(Windows) && !os(tvOS) XCTAssertEqual(fcmPayload.description, "{\"collapseKey\":\"nope\",\"data\":{\"help\":\"you\"},\"delayWhileIdle\":false,\"dryRun\":false,\"notification\":{\"android_channel_id\":\"you\",\"badge\":\"no\",\"body\":\"android\",\"body_loc-key\":\"cousin\",\"body-loc-args\":[\"mother\"],\"click_action\":\"to\",\"color\":\"blue\",\"icon\":\"world\",\"image\":\"icon\",\"sound\":\"yes\",\"subtitle\":\"trip\",\"tag\":\"it\",\"title\":\"hello\",\"title_loc_args\":[\"arg\"],\"title_loc_key\":\"it\"},\"restrictedPackageName\":\"geez\",\"title\":\"peace\",\"uri\":\"https:\\/\\/parse.org\"}") #endif @@ -228,7 +228,7 @@ class ParsePushPayloadAnyTests: XCTestCase { XCTAssertEqual(fcmPayload, decoded) let decoded2 = try ParseCoding.jsonDecoder().decode(ParsePushPayloadAny.self, from: encoded).convertToFirebase() XCTAssertEqual(decoded2, fcmPayload) - #if !os(Linux) && !os(Android) && !os(Windows) + #if !os(Linux) && !os(Android) && !os(Windows) && !os(tvOS) XCTAssertEqual(fcmPayload.description, "{\"collapseKey\":\"nope\",\"contentAvailable\":true,\"data\":{\"help\":\"you\"},\"delayWhileIdle\":false,\"dryRun\":false,\"mutableContent\":true,\"notification\":{\"android_channel_id\":\"you\",\"badge\":\"no\",\"body\":\"android\",\"body_loc-key\":\"cousin\",\"body-loc-args\":[\"mother\"],\"click_action\":\"to\",\"color\":\"blue\",\"icon\":\"world\",\"image\":\"icon\",\"sound\":\"yes\",\"subtitle\":\"trip\",\"tag\":\"it\",\"title\":\"hello\",\"title_loc_args\":[\"arg\"],\"title_loc_key\":\"it\"},\"priority\":\"high\",\"restrictedPackageName\":\"geez\",\"title\":\"peace\",\"uri\":\"https:\\/\\/parse.org\"}") #endif diff --git a/Tests/ParseSwiftTests/ParsePushPayloadFirebaseTests.swift b/Tests/ParseSwiftTests/ParsePushPayloadFirebaseTests.swift index 82dae0e1c..84dc6873f 100644 --- a/Tests/ParseSwiftTests/ParsePushPayloadFirebaseTests.swift +++ b/Tests/ParseSwiftTests/ParsePushPayloadFirebaseTests.swift @@ -71,7 +71,7 @@ class ParsePushPayloadFirebaseTests: XCTestCase { let encoded = try ParseCoding.parseEncoder().encode(fcmPayload) let decoded = try ParseCoding.jsonDecoder().decode(ParsePushPayloadFirebase.self, from: encoded) XCTAssertEqual(fcmPayload, decoded) - #if !os(Linux) && !os(Android) && !os(Windows) + #if !os(Linux) && !os(Android) && !os(Windows) && !os(tvOS) XCTAssertEqual(fcmPayload.description, "{\"collapseKey\":\"nope\",\"contentAvailable\":true,\"data\":{\"help\":\"you\"},\"delayWhileIdle\":false,\"dryRun\":false,\"mutableContent\":true,\"notification\":{\"android_channel_id\":\"you\",\"badge\":\"no\",\"body\":\"android\",\"body_loc-key\":\"cousin\",\"body-loc-args\":[\"mother\"],\"click_action\":\"to\",\"color\":\"blue\",\"icon\":\"world\",\"image\":\"icon\",\"sound\":\"yes\",\"subtitle\":\"trip\",\"tag\":\"it\",\"title\":\"hello\",\"title_loc_args\":[\"arg\"],\"title_loc_key\":\"it\"},\"priority\":\"high\",\"restrictedPackageName\":\"geez\",\"title\":\"peace\",\"uri\":\"https:\\/\\/parse.org\"}") #endif