assert_cmd icon indicating copy to clipboard operation
assert_cmd copied to clipboard

Add .try_assert() for a panic-free version of .assert()

Open gibfahn opened this issue 1 year ago • 1 comments

The test suite I'm working with uses file locks on destructors to ensure things run synchronously. Having tests panic breaks that (unless we catch panics). Easiest way is to use all the .try_*() methods like .try_success() and .try_stderr().

However as far as I can tell there isn't a Result-returning way to do .assert(), which can panic, so filing this issue to ask whether we could have that.

gibfahn avatar Mar 07 '24 13:03 gibfahn

Isn't that just output.ok()?.assert()?

epage avatar Mar 07 '24 14:03 epage