Replies: 2 comments
-
This problem has been fixed. So, only a problem related xcpretty is remained. The xcpretty related problem can be fixed by placing |
Beta Was this translation helpful? Give feedback.
-
I came here to see if there was a proposal on this. I think it's a great idea. In the JS world, the de facto standard for tests is Jest. One reason is that it has a really good dev experience. They use diffs to express failed expectations in complex objects, and the result is very clean. Here is an example output. Note how they don't necessarily print the entire diff, just the parts where there's a difference between received and expected: |
Beta Was this translation helpful? Give feedback.
-
I am a developer of a MirrorDiffKit that is a structual diff library.
I think MirrorDiffKit is useful for Nimble users on some conditions.
So, can Nimble use MirrorDiffKit internally?
How do you feel about it?
Motivation
The output of verifying structs or classes that have many stored properties with Nimble is hard to read:
In this case, MirrorDiffKit is useful.
MirrorDiffKit is a diff library that can output stored property differences between two structs or classes or enums.
For example, the following string is an output of
diff(between:T, and:T)
:It can make readable output when comparing two structs or classes or enums that have many properties:
And also, it can make readable output when comparing two sequences that have different order:
As seen above, MirrorDiffKit can help Nimble.
Advantage and Disadvantage
Advantage:
Disadvantage:
Problem about CoreGraphics ObjectsCurrently MirrorDiffKit is not familiar with CoreGraphics Objects.For example, MirrorDiffKit returns the following broken output when comparing 2 CGSize:Output via xcpretty can be broken
I note the example output at end of the description.
Example Project
https://github.com/Kuniwak/QuickPlaygound
Example Code
Example Output
xcodebuild test
xcpretty
Beta Was this translation helpful? Give feedback.
All reactions