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

Function hook_alternate

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

Source from the content-addressed store, hash-verified

526
527 #[test]
528 fn hook_alternate() {
529 let _guard = prepare(false);
530
531 let report = create_report().attach_opaque(2_u64);
532
533 Report::install_debug_hook::<u64>(|_, context| {
534 if context.alternate() {
535 context.push_appendix("Snippet");
536 }
537
538 context.push_body("Empty");
539 });
540
541 assert_snapshot!("norm", format!("{report:?}"));
542
543 assert_snapshot!("alt", format!("{report:#?}"));
544 }
545
546 #[test]
547 fn hook_location() {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected