MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_hook_result_constructors

Function test_hook_result_constructors

core/src/hooks/engine.rs:488–507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

486
487 #[test]
488 fn test_hook_result_constructors() {
489 let cont = HookResult::continue_();
490 assert!(cont.is_continue());
491 assert!(!cont.is_block());
492
493 let cont_with = HookResult::continue_with(serde_json::json!({"key": "value"}));
494 assert!(cont_with.is_continue());
495
496 let block = HookResult::block("Blocked");
497 assert!(block.is_block());
498 assert!(!block.is_continue());
499
500 let retry = HookResult::retry(1000);
501 assert!(!retry.is_continue());
502 assert!(!retry.is_block());
503
504 let skip = HookResult::skip();
505 assert!(!skip.is_continue());
506 assert!(!skip.is_block());
507 }
508
509 #[test]
510 fn test_engine_register_unregister() {

Callers

nothing calls this directly

Calls 1

skipFunction · 0.85

Tested by

no test coverage detected