I was running the following code (paraphrased) in a test using Xcode 7b4, and it always failed :
let knownGoodString = "foobar"
XCTAssertTrue( someClassInstance.stringProperty == knownGoodString,
"String equality test failed, \(someClassInstance.stringProperty) != \(knownGoodString)" )
But the console transcript would show identical strings. After experimenting and reading the docs, I found that I needed to use XCTAssertEquality instead, so that problem was solved.
But why doesn't the equality operator return a true that satisfies the XCTest assertion? Is it a bug or do I just misunderstand something?
It seems like there must have been something else going on?
I generally use XCTAssert(), which is the same as XCTAssertTrue() according to the documentation, for all tests rather than using the more specific forms, and haven't had problems with doing equality tests with == at all.