Adding support for returning TestResult objects in #6 introduced an unexpected bug: the #[should_panic] attribute no longer functions correctly. #[should_panic] apparently only works in functions returning (), which raises questions as to the future direction of testing in this library:
Should an assertion library be made that returns Error objects as #7 suggests? Doing this would mean that #[should_panic] tests cannot actually work with these assertions
A custom assert_panic!(...) macro can be added that is implemented in terms of std::panic::handle_unwind -- however this is documented to only work for panics that perform unwinding. It's unclear if this is also the behavior of #[should_panic], or whether #[should_panic] can actually catch cases that abort.
A decision needs to be made in order to progress here. It's possible that supporting attributes in subtests in #14 might be sufficient for handling this, in that subtests can return () whereas other tests return Error.
Adding support for returning
TestResult
objects in #6 introduced an unexpected bug: the#[should_panic]
attribute no longer functions correctly.#[should_panic]
apparently only works in functions returning()
, which raises questions as to the future direction of testing in this library:Should an assertion library be made that returns
Error
objects as #7 suggests? Doing this would mean that#[should_panic]
tests cannot actually work with these assertionsA custom
assert_panic!(...)
macro can be added that is implemented in terms ofstd::panic::handle_unwind
-- however this is documented to only work for panics that perform unwinding. It's unclear if this is also the behavior of#[should_panic]
, or whether#[should_panic]
can actually catch cases that abort.A decision needs to be made in order to progress here. It's possible that supporting attributes in subtests in #14 might be sufficient for handling this, in that subtests can return
()
whereas other tests returnError
.