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

Function hook_incr

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

Source from the content-addressed store, hash-verified

509
510 #[test]
511 fn hook_incr() {
512 let _guard = prepare(false);
513
514 let report = create_report() //
515 .attach_opaque(1_u32)
516 .attach_opaque(2_u32)
517 .attach_opaque(3_u32);
518
519 Report::install_debug_hook::<u32>(|_, context| {
520 let idx = context.increment_counter();
521 context.push_body(idx.to_string());
522 });
523
524 assert_snapshot!(format!("{report:?}"));
525 }
526
527 #[test]
528 fn hook_alternate() {

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