(t *testing.T)
| 330 | } |
| 331 | |
| 332 | func TestAddCustomExtractor(t *testing.T) { |
| 333 | mustLoadTemplates(t) |
| 334 | |
| 335 | AddCustomExtractor("version", `version[:\s]+(\d+\.\d+\.\d+)`) |
| 336 | defer EnableExtractors(nil) |
| 337 | |
| 338 | if !IsProtonExtractor("custom-version") { |
| 339 | t.Error("custom extractor not found by ID") |
| 340 | } |
| 341 | |
| 342 | body := []byte(`<html>version: 2.1.0</html>`) |
| 343 | EnableExtractors([]string{"custom-version"}) |
| 344 | results := ProtonExtract(body) |
| 345 | |
| 346 | if len(results) == 0 { |
| 347 | t.Fatal("custom extractor returned no results") |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | func TestProtonExtractSeverity(t *testing.T) { |
| 352 | mustLoadTemplates(t) |
nothing calls this directly
no test coverage detected