Skip to content

Commit 74c9230

Browse files
committed
admit in test that older open source foundation implementations of the localized error are not so good
1 parent cae14e9 commit 74c9230

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Tests/JSONAPITests/Relationships/RelationshipTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,14 @@ extension RelationshipTests {
255255
try decodedThrows(type: ToManyWithMeta.self,
256256
data: to_many_relationship_with_meta_no_data)
257257
) { error in
258-
XCTAssertEqual(error.localizedDescription, "The data couldn’t be read because it is missing.")
258+
let oldLinuxFoundationMsg = "The operation could not be completed. (SwiftError error 0.)"
259+
let newLinuxFoundationMsg = "The operation could not be completed. The data is missing."
260+
let newDesirableMsg = "The data couldn’t be read because it is missing."
261+
XCTAssert(
262+
error.localizedDescription == newDesirableMsg
263+
|| error.localizedDescription == newLinuxFoundationMsg
264+
|| error.localizedDescription == oldLinuxFoundationMsg
265+
)
259266
}
260267
}
261268
}

0 commit comments

Comments
 (0)