(t *testing.T)
| 237 | } |
| 238 | |
| 239 | func TestNewExecutor(t *testing.T) { |
| 240 | t.Parallel() |
| 241 | |
| 242 | config := &Config{ |
| 243 | PreToolUse: []MatcherConfig{ |
| 244 | { |
| 245 | Matcher: "shell|edit_file", |
| 246 | Hooks: []Hook{ |
| 247 | {Type: HookTypeCommand, Command: "echo pre"}, |
| 248 | }, |
| 249 | }, |
| 250 | }, |
| 251 | } |
| 252 | |
| 253 | exec := NewExecutor(config, "/tmp", []string{"FOO=bar"}) |
| 254 | require.NotNil(t, exec) |
| 255 | assert.True(t, exec.Has(EventPreToolUse)) |
| 256 | assert.False(t, exec.Has(EventPostToolUse)) |
| 257 | assert.False(t, exec.Has(EventSessionStart)) |
| 258 | assert.False(t, exec.Has(EventSessionEnd)) |
| 259 | assert.False(t, exec.Has(EventStop)) |
| 260 | assert.False(t, exec.Has(EventNotification)) |
| 261 | } |
| 262 | |
| 263 | func TestExecutorNilConfig(t *testing.T) { |
| 264 | t.Parallel() |
nothing calls this directly
no test coverage detected