(t *testing.T)
| 458 | } |
| 459 | |
| 460 | func TestExecutePostToolUse(t *testing.T) { |
| 461 | t.Parallel() |
| 462 | |
| 463 | config := &Config{ |
| 464 | PostToolUse: []MatcherConfig{ |
| 465 | { |
| 466 | Matcher: "shell", |
| 467 | Hooks: []Hook{ |
| 468 | {Type: HookTypeCommand, Command: "echo 'post-hook'", Timeout: 5}, |
| 469 | }, |
| 470 | }, |
| 471 | }, |
| 472 | } |
| 473 | |
| 474 | exec := NewExecutor(config, t.TempDir(), nil) |
| 475 | input := &Input{ |
| 476 | SessionID: "test-session", |
| 477 | ToolName: "shell", |
| 478 | ToolUseID: "test-id", |
| 479 | ToolResponse: "command output", |
| 480 | } |
| 481 | |
| 482 | result, err := exec.Dispatch(t.Context(), EventPostToolUse, input) |
| 483 | require.NoError(t, err) |
| 484 | assert.True(t, result.Allowed) |
| 485 | } |
| 486 | |
| 487 | func TestExecuteSessionStart(t *testing.T) { |
| 488 | t.Parallel() |
nothing calls this directly
no test coverage detected