From 74c9230a2b9cce14631aadb99d9e6b4d8f758c3a Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Fri, 1 Mar 2024 12:30:31 -0600 Subject: [PATCH] admit in test that older open source foundation implementations of the localized error are not so good --- Tests/JSONAPITests/Relationships/RelationshipTests.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/JSONAPITests/Relationships/RelationshipTests.swift b/Tests/JSONAPITests/Relationships/RelationshipTests.swift index d600637..3decfae 100644 --- a/Tests/JSONAPITests/Relationships/RelationshipTests.swift +++ b/Tests/JSONAPITests/Relationships/RelationshipTests.swift @@ -255,7 +255,14 @@ extension RelationshipTests { try decodedThrows(type: ToManyWithMeta.self, data: to_many_relationship_with_meta_no_data) ) { error in - XCTAssertEqual(error.localizedDescription, "The data couldn’t be read because it is missing.") + let oldLinuxFoundationMsg = "The operation could not be completed. (SwiftError error 0.)" + let newLinuxFoundationMsg = "The operation could not be completed. The data is missing." + let newDesirableMsg = "The data couldn’t be read because it is missing." + XCTAssert( + error.localizedDescription == newDesirableMsg + || error.localizedDescription == newLinuxFoundationMsg + || error.localizedDescription == oldLinuxFoundationMsg + ) } } }