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

Function hook_for_context

libs/error-stack/tests/test_debug.rs:463–475  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

461
462 #[test]
463 fn hook_for_context() {
464 let _guard = prepare(false);
465
466 let report = create_report().attach_opaque(2_u32);
467
468 Report::install_debug_hook::<RootError>(|_, _| {
469 // This should not be displayed as `RootError` is only used as `Context`, never as
470 // attachment.
471 unreachable!("A context should never be used as hook");
472 });
473
474 assert_snapshot!(format!("{report:?}"));
475 }
476
477 #[test]
478 fn hook_multiple() {

Callers

nothing calls this directly

Calls 3

prepareFunction · 0.70
create_reportFunction · 0.70
attach_opaqueMethod · 0.45

Tested by

no test coverage detected