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

Function anyhow

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

Source from the content-addressed store, hash-verified

37#[test]
38#[cfg(all(feature = "std", feature = "anyhow"))]
39fn anyhow() {
40 let anyhow: Result<(), _> = Err(anyhow::anyhow!(RootError)
41 .context(PrintableA(0))
42 .context(PrintableB(0)));
43
44 let report = create_report().attach(PrintableA(0)).attach(PrintableB(0));
45
46 #[expect(unused_mut)]
47 let mut report_messages = messages(&report);
48
49 let anyhow_report = anyhow
50 .into_report()
51 .expect_err("should have returned error");
52 let anyhow_messages = messages(&anyhow_report);
53
54 assert_eq!(
55 remove_builtin_messages(anyhow_messages.into_iter().rev()),
56 remove_builtin_messages(report_messages),
57 );
58}
59
60#[test]
61#[cfg(all(not(feature = "std"), feature = "anyhow"))]

Callers

nothing calls this directly

Calls 8

ErrInterface · 0.85
PrintableAClass · 0.85
PrintableBClass · 0.85
messagesFunction · 0.85
create_reportFunction · 0.70
contextMethod · 0.45
attachMethod · 0.45
into_reportMethod · 0.45

Tested by

no test coverage detected