-
Notifications
You must be signed in to change notification settings - Fork 36
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
Easy "stdout contains" assertions #11
Comments
Any |
Ah, very cool. Couldn't find it because it's not yet in a released version. Sadly, it also doesn't seem to like |
Didn't realize it wasn't published. I'll get it out and update the tests, fixing ergonomics along the way. |
Need to come up with solutions for assert-rs/predicates-rs#20 Specifically for this case, the best I'm coming up with is adding a |
I'm trying to use this for a project instead of the published version of assert_cli. I'm super impressed by what you've accomplished here in the short time!
It seems that currently, there is no easy way to check that the output of a command contains some text. Or did I miss something?
Predicates only has a
str::contains
butstdout
is aVec<u8>
. It seems that it could work withpredicate::function
, but it is quite cumbersome. I'm basically looking for good way of writing.stdout(&predicate::function(|x: &Vec<u8>| String::from_utf8_lossy(x).contains("Done!")))
-- but ideally without the need to usefrom_utf8_lossy
. This last requirement is also why I opened this issue here, and not on the predicates, I expect we may need to talk about how to best deal with theVec<u8>
representation.The text was updated successfully, but these errors were encountered: