-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
brrrsuch code, much wowsuch code, much wow
Milestone
Description
While I'm at it, I think it would be wise to test for 'denormalized' Signed<Magnitude> equality, as opposed to 'normalized' equality. The difference being that Signed<Magnitude> treats positive and negative zero as 'equal' in the Equatable sense. There may be situations where these values are differentiated. I'm considering replacing XCTAssertEqual with:
func ANKAssertIdentical<T>(_ lhs: ANKSigned<T>, _ rhs: ANKSigned<T>, file: StaticString = #file, line: UInt = #line) {
let success: Bool = lhs.sign == rhs.sign && lhs.magnitude == rhs.magnitude
XCTAssert(success, "(\(lhs.sign)\(lhs.magnitude)) is not identical to (\(rhs.sign)\(rhs.magnitude))", file: file, line: line)
}Metadata
Metadata
Assignees
Labels
brrrsuch code, much wowsuch code, much wow