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

Pretty XCAssertEqual output #440

Open
AgranatMarkit opened this issue Apr 26, 2023 · 0 comments
Open

Pretty XCAssertEqual output #440

AgranatMarkit opened this issue Apr 26, 2023 · 0 comments

Comments

@AgranatMarkit
Copy link

AgranatMarkit commented Apr 26, 2023

There is a nice library

That uses custom dump

These libraries make XCTAssertEquals message's for complex structures to be very clear, for example:

  failed - A state change does not match expectation:  
        ObjectDetectionState(  
           image: nil,  
     -     previewState: .image(.camera),  
     +     previewState: .live,  
           focusPoint: nil. 
        )  
   (Expected: -, Actual: +)  

Instead of:

XCTAssertEqual failed:  (ObjectDetectionState(image: nil, previewState: SearchMode.DetectionsTrackerState.live, focusPoint: nil)) is not matching (ObjectDetectionState(image: nil, previewState: SearchMode.DetectionsTrackerState..image(.camera), focusPoint: nil))

In case of structures with >= 10 properties it become completely impossible to find the change without using other tools.

It would be nice if you would incorporate this libraries or made some changes to output of XCTAssert result messages.
Would you like to consider such options please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants