Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
18
third-party/vendor/eyre/tests/test_no_install.rs
vendored
Normal file
18
third-party/vendor/eyre/tests/test_no_install.rs
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#![cfg(not(feature = "auto-install"))]
|
||||
|
||||
use eyre::{eyre, set_hook, DefaultHandler, Report};
|
||||
|
||||
#[test]
|
||||
fn test_no_hook_panic() {
|
||||
let panic_res = std::panic::catch_unwind(|| eyre!("this will never be displayed"));
|
||||
assert!(panic_res.is_err());
|
||||
|
||||
let downcast_res = panic_res.unwrap_err().downcast::<String>();
|
||||
assert_eq!(
|
||||
*downcast_res.unwrap(),
|
||||
"a handler must always be installed if the `auto-install` feature is disabled"
|
||||
);
|
||||
|
||||
assert!(set_hook(Box::new(DefaultHandler::default_with)).is_ok());
|
||||
let _error: Report = eyre!("this will be displayed if returned");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue