(t *testing.T)
| 186 | } |
| 187 | |
| 188 | func TestMissingToolConfigParsing(t *testing.T) { |
| 189 | compiler := NewCompiler() |
| 190 | |
| 191 | tests := []struct { |
| 192 | name string |
| 193 | configData map[string]any |
| 194 | expectMax int |
| 195 | expectCreateIssue *string |
| 196 | expectTitlePrefix string |
| 197 | expectLabels []string |
| 198 | expectError bool |
| 199 | }{ |
| 200 | { |
| 201 | name: "Empty config - defaults", |
| 202 | configData: map[string]any{"missing-tool": nil}, |
| 203 | expectMax: 0, |
| 204 | expectCreateIssue: strPtr("false"), |
| 205 | expectTitlePrefix: "[missing tool]", |
| 206 | expectLabels: []string{}, |
| 207 | }, |
| 208 | { |
| 209 | name: "Config with max as int", |
| 210 | configData: map[string]any{ |
| 211 | "missing-tool": map[string]any{"max": 5}, |
| 212 | }, |
| 213 | expectMax: 5, |
| 214 | expectCreateIssue: strPtr("false"), |
| 215 | expectTitlePrefix: "[missing tool]", |
| 216 | expectLabels: []string{}, |
| 217 | }, |
| 218 | { |
| 219 | name: "Config with max as float64 (from YAML)", |
| 220 | configData: map[string]any{ |
| 221 | "missing-tool": map[string]any{"max": float64(10)}, |
| 222 | }, |
| 223 | expectMax: 10, |
| 224 | expectCreateIssue: strPtr("false"), |
| 225 | expectTitlePrefix: "[missing tool]", |
| 226 | expectLabels: []string{}, |
| 227 | }, |
| 228 | { |
| 229 | name: "Config with max as int64", |
| 230 | configData: map[string]any{ |
| 231 | "missing-tool": map[string]any{"max": int64(15)}, |
| 232 | }, |
| 233 | expectMax: 15, |
| 234 | expectCreateIssue: strPtr("false"), |
| 235 | expectTitlePrefix: "[missing tool]", |
| 236 | expectLabels: []string{}, |
| 237 | }, |
| 238 | { |
| 239 | name: "No missing-tool key", |
| 240 | configData: map[string]any{}, |
| 241 | expectMax: -1, // Indicates nil config |
| 242 | }, |
| 243 | { |
| 244 | name: "Explicit false disables missing-tool", |
| 245 | configData: map[string]any{ |
nothing calls this directly
no test coverage detected