(t *testing.T)
| 485 | } |
| 486 | |
| 487 | func TestExecuteSessionStart(t *testing.T) { |
| 488 | t.Parallel() |
| 489 | |
| 490 | config := &Config{ |
| 491 | SessionStart: []Hook{ |
| 492 | {Type: HookTypeCommand, Command: "echo 'session starting'", Timeout: 5}, |
| 493 | }, |
| 494 | } |
| 495 | |
| 496 | exec := NewExecutor(config, t.TempDir(), nil) |
| 497 | input := &Input{ |
| 498 | SessionID: "test-session", |
| 499 | Source: "startup", |
| 500 | } |
| 501 | |
| 502 | result, err := exec.Dispatch(t.Context(), EventSessionStart, input) |
| 503 | require.NoError(t, err) |
| 504 | assert.True(t, result.Allowed) |
| 505 | assert.Contains(t, result.AdditionalContext, "session starting") |
| 506 | } |
| 507 | |
| 508 | func TestExecuteSessionEnd(t *testing.T) { |
| 509 | t.Parallel() |
nothing calls this directly
no test coverage detected