MCPcopy Create free account
hub / github.com/hashintel/hash / eyre_output

Function eyre_output

libs/error-stack/tests/test_compatibility.rs:198–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196 ignore = "bug: miri is failing for `eyre`, this is unrelated to our implementation"
197)]
198fn eyre_output() {
199 install_eyre_hook();
200
201 let eyre = eyre::eyre!(RootError)
202 .wrap_err(PrintableA(0))
203 .wrap_err(PrintableB(0));
204
205 let eyre_debug_normal = format!("{eyre:?}");
206 let eyre_debug_extended = format!("{eyre:#?}");
207 let eyre_display_normal = format!("{eyre:}");
208 let eyre_display_extended = format!("{eyre:#}");
209
210 let eyre_report = Err::<(), _>(eyre)
211 .into_report()
212 .expect_err("should have returned error");
213 let context = eyre_report.current_context();
214
215 let context_debug_normal = format!("{context:?}");
216 let context_debug_extended = format!("{context:#?}");
217 let context_display_normal = format!("{context:}");
218 let context_display_extended = format!("{context:#}");
219
220 assert_eq!(eyre_debug_normal, context_debug_normal);
221 assert_eq!(eyre_debug_extended, context_debug_extended);
222 assert_eq!(eyre_display_normal, context_display_normal);
223 assert_eq!(eyre_display_extended, context_display_extended);
224}

Callers

nothing calls this directly

Calls 5

install_eyre_hookFunction · 0.85
PrintableAClass · 0.85
PrintableBClass · 0.85
current_contextMethod · 0.80
into_reportMethod · 0.45

Tested by

no test coverage detected