You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of right now, we can only handle predicates on one field at a time. I'm doubtful we'll be enabling ore complex ones.
In considering more complex expressions, one of the problems is the termination case, what causes us to evaluate all of it.
assert_cmd (at that time assert_cli) supported building expressions (before the execution happened). We simplified to being a thinner wrapping around Command but without us carrying any data because of that, we had to move the assertions to happen after the command runs. The problem we ran into was evaluating the expression. Its very easy to forget (though maybe we could play with must_use).
Then next problem is naming.
After that is how do we enable these arbitrary declarative-like logical conditions. Do we explicitly not support nested expressions? If we support them, what would the API look like?
With all of this, what is the ergonomics of the API compared to writing a more imperative logic.
I want to say something like this:
But I don't see an
or()
function, or any function taking an arbitrary Predicate instead of a built-in assertion. In the meantime I can use https://doc.rust-lang.org/std/process/struct.Command.html#method.output, but it would be nice to have something built-in.The text was updated successfully, but these errors were encountered: