WCPISJ4XXCQWQTGDUHPSEI6UFTAJHLAU54CAMOXXSVHQPLAV4DEAC
EB2Z5XFTQX2SVCOSUYN6HZYCTW6PHLAXGIUV3HSHP72RVR3IDSOAC
R2FB5PBSU5SCGAQ33AKFG5WJ2T2L7ZDA4LDKTIKRMBGVA2ST5YPQC
use std::io;
bail!("oh no!");
bail!(io::Error::new(io::ErrorKind::PermissionDenied, "oh no!"));
const EXPECTED_ALTDISPLAY_F: &str = "\oh no!\";const EXPECTED_ALTDISPLAY_G: &str = "\f failedCaused by: oh no!\";const EXPECTED_ALTDISPLAY_H: &str = "\g failedCaused by: 0: f failed 1: oh no!\";
const EXPECTED_ALTDISPLAY_F: &str = "\
oh no!\
";
const EXPECTED_ALTDISPLAY_G: &str = "\
f failed
Caused by:
const EXPECTED_ALTDISPLAY_H: &str = "\
g failed
0: f failed
1: oh no!\
";const EXPECTED_ALTDEBUG_F: &str = "\Custom { kind: PermissionDenied, error: \"oh no!\",}\";const EXPECTED_ALTDEBUG_G: &str = "\Error { context: \"f failed\", source: Custom { kind: PermissionDenied, error: \"oh no!\", },}\
const EXPECTED_ALTDEBUG_F: &str = "\
Custom {
kind: PermissionDenied,
error: \"oh no!\",
}\
const EXPECTED_ALTDEBUG_G: &str = "\
Error {
context: \"f failed\",
source: Custom {
},
const EXPECTED_ALTDEBUG_H: &str = "\Error { context: \"g failed\", source: Error { context: \"f failed\", source: Custom { kind: PermissionDenied, error: \"oh no!\", }, },}\";
const EXPECTED_ALTDEBUG_H: &str = "\
context: \"g failed\",
source: Error {
}#[test]fn test_altdisplay() { assert_eq!(EXPECTED_ALTDISPLAY_F, format!("{:#}", f().unwrap_err())); assert_eq!(EXPECTED_ALTDISPLAY_G, format!("{:#}", g().unwrap_err())); assert_eq!(EXPECTED_ALTDISPLAY_H, format!("{:#}", h().unwrap_err()));
}
#[test]
fn test_altdisplay() {
assert_eq!(EXPECTED_ALTDISPLAY_F, format!("{:#}", f().unwrap_err()));
assert_eq!(EXPECTED_ALTDISPLAY_G, format!("{:#}", g().unwrap_err()));
assert_eq!(EXPECTED_ALTDISPLAY_H, format!("{:#}", h().unwrap_err()));
}#[test]fn test_altdebug() { assert_eq!(EXPECTED_ALTDEBUG_F, format!("{:#?}", f().unwrap_err())); assert_eq!(EXPECTED_ALTDEBUG_G, format!("{:#?}", g().unwrap_err())); assert_eq!(EXPECTED_ALTDEBUG_H, format!("{:#?}", h().unwrap_err()));
fn test_altdebug() {
assert_eq!(EXPECTED_ALTDEBUG_F, format!("{:#?}", f().unwrap_err()));
assert_eq!(EXPECTED_ALTDEBUG_G, format!("{:#?}", g().unwrap_err()));
assert_eq!(EXPECTED_ALTDEBUG_H, format!("{:#?}", h().unwrap_err()));