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

Diff-style output for verification failures #102

Open
jtyers opened this issue May 22, 2020 · 1 comment
Open

Diff-style output for verification failures #102

jtyers opened this issue May 22, 2020 · 1 comment

Comments

@jtyers
Copy link

jtyers commented May 22, 2020

I have a test making calls to an interface with a fairly large struct. When the test fails owing to a verification failure, I have to scan through the error text to find the differences. Other frameworks I've used display a diff of the input/output (diffing the expected call versus actual call) to allow me to quickly see what is wrong.

Could you add similar diff-style output to pegomock? It would make it much easier to narrow down bugs.

@petergtz
Copy link
Owner

Hi @jtyers, thanks for reporting this. What you write makes a lot of sense and I wished for the same feature a couple of times in the past. Unfortunately, these days I can't tell when I will be able to implement this. However, I'd be more than happy to merge a PR if you want to contribute.

Should you be interested, then it will probably make sense to quickly discuss here what the current output looks like in your specific case, and what you'd roughly wish for.

BTW, the code portion that does the verification is in:
https://github.com/petergtz/pegomock/blob/master/dsl.go#L96-L159

Let me know what you think.
Thanks,
Peter

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

2 participants