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

fix: Report user value #117

Merged
merged 3 commits into from Nov 22, 2021
Merged

fix: Report user value #117

merged 3 commits into from Nov 22, 2021

Conversation

epage
Copy link
Contributor

@epage epage commented Nov 22, 2021

With some predicates, we show the user value (diff) but others do not.
This makes it more consistent. We aim to show the user value in leaf
predicates and in major adapters.

  • Some leaf predicates can't show a value (function)
  • Some defer to a file on disk, so we leave it at that, in case the file
    is too big or ugly to shoe
  • Simple adapters, like trim don't show. So far, the only worthwhile
    one is eq_file.

By leaving things to the leaves, we are able to show the value after its
gone through transforms, like UTF-8, or loading a file path.

Fixes #116

We were showing the child predicate twice, one underneath the other,
because we both forwarded its `Display` *and* added `self` to the case
tree.
With some predicates, we show the user value (diff) but others do not.
This makes it more consistent.  We aim to show the user value in leaf
predicates and in major adapters.
- Some leaf predicates can't show a value (function)
- Some defer to a file on disk, so we leave it at that, in case the file
  is too big or ugly to shoe
- Simple adapters, like `trim` don't show.  So far, the only worthwhile
  one is `eq_file`.

By leaving things to the leaves, we are able to show the value after its
gone through transforms, like UTF-8, or loading a file path.

Fixes assert-rs#116
@epage epage merged commit 4e43205 into assert-rs:master Nov 22, 2021
@epage epage deleted the fix branch November 22, 2021 18:57
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.

Predicates showing one value of the comparison but not the other
1 participant