Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No diff when comparing two instances of UIImage or #imageLiteral using XCTAssertNoDifference #70

Open
mikevelu opened this issue Jan 4, 2023 · 0 comments

Comments

@mikevelu
Copy link

mikevelu commented Jan 4, 2023

Describe the bug

When comparing instances of UIImage or #imageLiteral XCTAssertNoDifference doesn't provide a diff, XCTAssertEqual does.

To Reproduce
testExample in ImageResourceComparisonDemoTests has some assertions which show the difference
ImageResourceComparisonDemo.zip

XCTAssertEqual(
    #imageLiteral(
        resourceName: "ExampleImage"
    ),
    #imageLiteral(
        resourceName: "ExampleImage2"
    )
)

// 👆 Produces this diff:

/**
testExample(): XCTAssertEqual failed: ("<UIImage:0x600002d50480 named(main: ExampleImage) {1200, 1200} renderingMode=automatic(original)>") is not equal to ("<UIImage:0x600002d505a0 named(main: ExampleImage2) {1200, 1200} renderingMode=automatic(original)>")
*/

XCTAssertNoDifference(
    #imageLiteral(
        resourceName: "ExampleImage"
    ),
    #imageLiteral(
        resourceName: "ExampleImage2"
    )
)

// 👆 Produces this diff:

/**
testExample(): XCTAssertNoDifference failed: …

  − UIImage()
  + UIImage()

(First: −, Second: +)
*/

Expected behavior
I'd have expected XCTAssertNoDifference to give me an indication of what the difference between the two images is, similar to what XCTAssertEqual does.

Environment

  • swift-custom-dump version [0.6.1]
  • Xcode [14.0.1]
  • Swift [5.7]
  • OS: [iOS 16.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant