()
| 101 | #[test] |
| 102 | #[cfg(feature = "anyhow")] |
| 103 | fn anyhow_output() { |
| 104 | let anyhow = anyhow::anyhow!(RootError) |
| 105 | .context(PrintableA(0)) |
| 106 | .context(PrintableB(0)); |
| 107 | |
| 108 | let anyhow_debug_normal = format!("{anyhow:?}"); |
| 109 | let anyhow_debug_extended = format!("{anyhow:#?}"); |
| 110 | let anyhow_display_normal = format!("{anyhow:}"); |
| 111 | let anyhow_display_extended = format!("{anyhow:#}"); |
| 112 | |
| 113 | let anyhow_report = Err::<(), _>(anyhow) |
| 114 | .into_report() |
| 115 | .expect_err("should have returned error"); |
| 116 | let context = anyhow_report.current_context(); |
| 117 | |
| 118 | let context_debug_normal = format!("{context:?}"); |
| 119 | let context_debug_extended = format!("{context:#?}"); |
| 120 | let context_display_normal = format!("{context:}"); |
| 121 | let context_display_extended = format!("{context:#}"); |
| 122 | |
| 123 | assert_eq!(anyhow_debug_normal, context_debug_normal); |
| 124 | assert_eq!(anyhow_debug_extended, context_debug_extended); |
| 125 | assert_eq!(anyhow_display_normal, context_display_normal); |
| 126 | assert_eq!(anyhow_display_extended, context_display_extended); |
| 127 | } |
| 128 | |
| 129 | #[cfg(feature = "eyre")] |
| 130 | fn install_eyre_hook() { |
nothing calls this directly
no test coverage detected