Skip to content

Commit e9b9dbc

Browse files
committed
sanity check test and note on the insanity
1 parent c825eed commit e9b9dbc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Tests/JSONAPITests/SwiftIdentifiableTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ final class SwiftIdentifiableTests: XCTestCase {
2525
XCTAssertEqual(hash[t1.id], String(describing: t1.id))
2626
XCTAssertEqual(hash[t2.id], String(describing: t2.id))
2727
}
28+
29+
func test_Id_ID_equivalence() {
30+
// it's not at all great to have both of these names for
31+
// the Id type, but I could not do better than this and
32+
// still have a typealias for the Id type on the
33+
// ResourceObjectProxy protocol. One protocol's typealias
34+
// will collide with anotehr protocol's associatedtype in
35+
// very ugly ways.
36+
37+
XCTAssert(TestType.ID.self == TestType.Id.self)
38+
39+
XCTAssertEqual(TestType.ID(rawValue: "hello"), TestType.Id(rawValue: "hello"))
40+
}
2841
}
2942

3043
fileprivate enum TestDescription: JSONAPI.ResourceObjectDescription {

0 commit comments

Comments
 (0)