()
| 606 | |
| 607 | #[tokio::test] |
| 608 | async fn test_engine_fire_with_block_handler() { |
| 609 | let engine = HookEngine::new(); |
| 610 | engine.register(Hook::new("test-hook", HookEventType::PreToolUse)); |
| 611 | engine.register_handler( |
| 612 | "test-hook", |
| 613 | Arc::new(BlockHandler { |
| 614 | reason: "Dangerous command".to_string(), |
| 615 | }), |
| 616 | ); |
| 617 | |
| 618 | let event = make_pre_tool_event("s1", "Bash"); |
| 619 | let result = engine.fire(&event).await; |
| 620 | |
| 621 | assert!(result.is_block()); |
| 622 | if let HookResult::Block(reason) = result { |
| 623 | assert_eq!(reason, "Dangerous command"); |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | #[tokio::test] |
| 628 | async fn test_engine_fire_priority_order() { |
nothing calls this directly
no test coverage detected