MCPcopy Create free account
hub / github.com/vale-cli/vale / TestExistence

Function TestExistence

internal/check/existence_test.go:26–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func 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
48func FuzzExistenceInit(f *testing.F) {
49 f.Add("hello")

Callers

nothing calls this directly

Calls 5

NewConfigFunction · 0.92
NewFileFunction · 0.92
NewBlockFunction · 0.92
makeExistenceFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…