Repository navigation
v1.2: Concurrent diffs with Differ - #71
daniel-nichter wants to merge 15 commits into
Conversation
Make concurrency-friendly by adding a type that captures desired config options. Existing API fully preserved.
|
@acorello Do you use I' m renaming stuff a bit that you can see in this PR. |
…ame InlineTest to InlineTesting; update docs and README
|
After using v1.2 in a real project, the original "ergonomics" weren't smooth enough. E.g. I can't type |
| } | ||
|
|
||
| c.equals(aVal, bVal, 0) | ||
| c.equals(aVal, bVal, 0) // full diff |
There was a problem hiding this comment.
I reckon you could put this in an else branch of the previous conditional, and remove the goto?
Hey, thanks for asking. Just want to confirm I'm not using it. |
I have enjoyed using rliebz/ghost to turn my assertions into readable one-liners, in small personal projects. Example: g := ghost.New(t)
got, err := MyFunc()
g.NoError(err)
g.MustNot(be.Nil(got)) // Must calls `t.Fatal`
g.Should(be.Equal(got.SomeString, "my value")) // Should calls `t.Error`I thought you may be interested if the desire to have a single inline The API consists of a handful of assertions on Looking at your recent changes I started wondering whether to delegate the handling/wrapping of I do anticipate anticipate one issue: is I'm not able to explore the design implications yet, but thought of sharing the idea. Thanks for sharing your work! |
v1.2 is based on #68. It adds:
Differto allow concurrent diffs (i.e. no global/pkg vars thatdeep.Equal()uses)WithInlineTesting) shown belowOriginal:
New:
But then I realized I could do something I've been doing recently in another project:
After many years of that boilerplate, I'm happy to get rid of it cleanly with this new
Differdesign.There's also
Equalffor custom error message formatting.