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

Display the pretty difference when a test fails #203

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

codingkarthik
Copy link

  • RFC
  • Specification updates
    • Changelog
    • Specification pages
    • Tutorial pages
    • reference/types.md
  • Implement your feature in the reference connector
  • Generate test cases in ndc-test if appropriate
  • Does your feature add a new capability?
    • Update specification/capabilities.md in the specification
    • Check the capability in ndc-test

return Err(Error::ResponseDidNotMatchSnapshot(
snapshot_path.to_path_buf(),
actual,
format!("{compare}"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any use in storing this here, or can we just move the format! into the Display implementation for the error type?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I did want to move into the error, but then compare's type is pretty_assertions::Comparison<R, R> and it would require extending parameterizing the Error type to Error<R>, which would be a substantial change, so for simplicity, I am converting it to String.

@codingkarthik codingkarthik requested a review from paf31 February 19, 2025 10:27
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

Successfully merging this pull request may close these issues.

2 participants