Skip to content

Commit

Permalink
sanity check test and note on the insanity
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed May 30, 2020
1 parent c825eed commit e9b9dbc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/JSONAPITests/SwiftIdentifiableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ final class SwiftIdentifiableTests: XCTestCase {
XCTAssertEqual(hash[t1.id], String(describing: t1.id))
XCTAssertEqual(hash[t2.id], String(describing: t2.id))
}

func test_Id_ID_equivalence() {
// it's not at all great to have both of these names for
// the Id type, but I could not do better than this and
// still have a typealias for the Id type on the
// ResourceObjectProxy protocol. One protocol's typealias
// will collide with anotehr protocol's associatedtype in
// very ugly ways.

XCTAssert(TestType.ID.self == TestType.Id.self)

XCTAssertEqual(TestType.ID(rawValue: "hello"), TestType.Id(rawValue: "hello"))
}
}

fileprivate enum TestDescription: JSONAPI.ResourceObjectDescription {
Expand Down

0 comments on commit e9b9dbc

Please sign in to comment.