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

Function hook_context

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

Source from the content-addressed store, hash-verified

447
448 #[test]
449 fn hook_context() {
450 let _guard = prepare(false);
451
452 let report = create_report().attach_opaque(2_u32);
453
454 Report::install_debug_hook::<u32>(|_, context| {
455 let idx = context.increment_counter();
456 context.push_body(format!("unsigned 32bit integer (No. {idx})"));
457 });
458
459 assert_snapshot!(format!("{report:?}"));
460 }
461
462 #[test]
463 fn hook_for_context() {

Callers

nothing calls this directly

Calls 4

push_bodyMethod · 0.80
prepareFunction · 0.70
create_reportFunction · 0.70
attach_opaqueMethod · 0.45

Tested by

no test coverage detected