You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If you’ll run this test:
func testAttributedString()throws{varstringOne=AttributedString("One")
stringOne.font =.body
varstringTwo=AttributedString("One")
stringTwo.font =.callout
XCTAssertNoDifference(stringOne, stringTwo)}
// It’ll fail, but the printed dump will make it look like there are no differences at all:
XCTAssertNoDifference failed:…"One"(First:−, Second:+)
// Where if I change the text to be different in addition to the font:
func testAttributedString()throws{varstringOne=AttributedString("One")
stringOne.font =.body
varstringTwo=AttributedString("Two")
stringTwo.font =.callout
XCTAssertNoDifference(stringOne, stringTwo)}
// it prints it correctly:
XCTAssertNoDifference failed:…−"One"+"Two"(First:−, Second:+)
// This problem is especially prominent when the AttributedString is a property of a State object inside of a Store, the test could fail and you’ll have no idea that the AttributedString is the one which is different:
XCTAssertNoDifference failed:…
State(
string:"One",
number:3)(First:−, Second:+)
Expected behavior
// In my opinion I would expect at least:
-"One"+"One"
Environment
swift-custom-dump 1.1.2
Xcode 15.0 (15A240d)
Swift 5.9
OS: iOS 17.0
The text was updated successfully, but these errors were encountered:
Describe the bug
Some
AttributedString
s don't print any diffs although they are not equalTo Reproduce
CustomDumpAttributedString.zip
Expected behavior
Environment
The text was updated successfully, but these errors were encountered: