(t *testing.T)
| 24 | } |
| 25 | |
| 26 | func TestExistence(t *testing.T) { |
| 27 | rule, err := makeExistence([]string{"test"}) |
| 28 | if err != nil { |
| 29 | t.Fatal(err) |
| 30 | } |
| 31 | |
| 32 | cfg, err := core.NewConfig(&core.CLIFlags{}) |
| 33 | if err != nil { |
| 34 | t.Fatal(err) |
| 35 | } |
| 36 | |
| 37 | file, err := core.NewFile("", cfg) |
| 38 | if err != nil { |
| 39 | t.Fatal(err) |
| 40 | } |
| 41 | |
| 42 | alerts, _ := rule.Run(nlp.NewBlock("", "This is a test.", ""), file, cfg) |
| 43 | if len(alerts) != 1 { |
| 44 | t.Errorf("expected one alert, not %v", alerts) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func FuzzExistenceInit(f *testing.F) { |
| 49 | f.Add("hello") |
nothing calls this directly
no test coverage detected
searching dependent graphs…