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

Refactor output #87

Merged
merged 5 commits into from
Feb 4, 2018
Merged

Refactor output #87

merged 5 commits into from
Feb 4, 2018

Conversation

epage
Copy link
Collaborator

@epage epage commented Feb 3, 2018

This PR (mostly) keeps the same API but replaces the guts with those from #74.

Other foundational output predicate functionality is added in to help this serve as a base for further work (like regexes in #85).

Move from a `bool` to track the type of output predicate to a stateful
enum.
This accepts a message with it.  This should hit the 90% case of a
`satisfies_ok` (or whatever it'd be called).

I'm also assuming that it'll be a best practice to document the custom
predicates, so its acceptable to force it on everyone.

If a `satisfies_ok` is found to be needed, I'm assuming its because the
user wants to tie into existing machinery that has error reporting.  This
means we'll probably need to accept an `Fn` that `Box`es the error to
preserve it.

Fixes assert-rs#55
`.stdin()` can now accept anything convertable to bytes, including
`str`, `OsStr`, and `[u8]`.
If you pass a `&str` into the predicates, the programs output is assumed
to be UTF-8 and will be converted accordingly.

If you pass `&[u8]` into the predicates, the program output is treated
as raw binary.

Fixes assert-rs#80
@epage epage mentioned this pull request Feb 4, 2018
4 tasks
@epage epage merged commit 62a1720 into assert-rs:master Feb 4, 2018
@epage epage deleted the refactor_output branch February 4, 2018 03:30
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.

1 participant