Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.

Conversation

@epage
Copy link
Collaborator

@epage epage commented Sep 27, 2017

  • Show stdout/stderr on exit code failures
  • Show expected/got strings for output assertions

This also includes a minor refactor to simplify output.rs.

stdout and stderr will now be shown when the exit code is an unexpected
value.  This will serve to provide additional context for the developer
without them having to fire up a debugger or manually reproduce the
failure condition.
@epage epage mentioned this pull request Sep 27, 2017
Copy link
Collaborator

@killercup killercup left a comment

Choose a reason for hiding this comment

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

LGTM

This reminds me: We should add tests for this.

self.matches_exact(&observed)
};
result.map_err(|e| self.kind.map_err(e, cmd))
result.map_err(|e| super::errors::ErrorKind::OutputMismatch(cmd.to_vec(), e, self.kind))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isnt't ErrorKind in scope from the glob import?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The ErrorKind that is in scope is from self, not super.

@epage
Copy link
Collaborator Author

epage commented Sep 27, 2017

bors: r+

bors bot added a commit that referenced this pull request Sep 27, 2017
43: Increase context on failures r=epage a=epage

- Show stdout/stderr on exit code failures
- Show expected/got strings for output assertions

This also includes a minor refactor to simplify `output.rs`.
@bors
Copy link
Contributor

bors bot commented Sep 27, 2017

Build succeeded

@bors bors bot merged commit 44a40f9 into assert-rs:master Sep 27, 2017
@epage epage deleted the error branch September 27, 2017 15:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants