(t *testing.T)
| 16 | } |
| 17 | |
| 18 | func TestMatchToolPattern(t *testing.T) { |
| 19 | tests := []struct { |
| 20 | pattern string |
| 21 | tool string |
| 22 | expected bool |
| 23 | }{ |
| 24 | {"*", "anything", true}, |
| 25 | {"mcp_*", "mcp_read_file", true}, |
| 26 | {"mcp_*", "@coder", false}, |
| 27 | {"@coder", "@coder", true}, |
| 28 | {"@coder", "@other", false}, |
| 29 | } |
| 30 | for _, tt := range tests { |
| 31 | if got := matchToolPattern(tt.pattern, tt.tool); got != tt.expected { |
| 32 | t.Errorf("matchToolPattern(%q, %q) = %v, want %v", tt.pattern, tt.tool, got, tt.expected) |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestHookConfig_IsEnabled(t *testing.T) { |
| 38 | h1 := HookConfig{Name: "test"} |
nothing calls this directly
no test coverage detected