()
| 16 | #[test] |
| 17 | #[cfg(any(nightly, feature = "std"))] |
| 18 | fn error() { |
| 19 | let report = create_report().change_context(ContextA(10)); |
| 20 | let error_ref = report.as_error(); |
| 21 | assert_eq!(error_ref.to_string(), "context A"); |
| 22 | #[cfg(nightly)] |
| 23 | assert_eq!( |
| 24 | *error::request_ref::<u32>(error_ref).expect("requested value not found"), |
| 25 | 10 |
| 26 | ); |
| 27 | |
| 28 | let error = report.into_error(); |
| 29 | assert_eq!(error.to_string(), "context A"); |
| 30 | #[cfg(nightly)] |
| 31 | assert_eq!( |
| 32 | *error::request_ref::<u32>(&error).expect("requested value not found"), |
| 33 | 10 |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | #[test] |
| 38 | #[cfg(all(feature = "std", feature = "anyhow"))] |
nothing calls this directly
no test coverage detected