Open dabrahams opened 10 months ago
I think we'd still want the quotes for anything conforming to StringProtocol
, but I agree they (and probably the parentheses too?) aren't immediately meaningful for other data types.
The parenthesis might be helpful to separate out the value we are asserting vs. the logging text.
However, the quotes could be misleading because it wraps everything with quotes regardless to type..
Maybe we can include the data type in the assertion message too? So, the final output would look sth like this:
XCTAssertEqual failed: Int(3) is not equal to Int(1)
XCTAssertEqual failed: String("Hello World") is not equal to String("hello")
what does everyone think? @grynspan @dabrahams
I've taken my PR to draft while we discuss it
I don't morally object, though I know a lot of code that integrates with XCTest is sensitive to formatting changes. @briancroom what do you think?
When this test fails:
The output is
The quotes around the values are both needless and misleading; they give the impression that I was testing for string equality.