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

Function Test_applyPatterns_errors

internal/lint/html_test.go:103–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

101}
102
103func Test_applyPatterns_errors(t *testing.T) {
104 cases := []struct {
105 description string
106 conf core.Config
107 exts extensionConfig
108 content string
109 expectedErr string
110 }{
111 {
112 description: "only one delimiter",
113 conf: core.Config{
114 CommentDelimiters: map[string][2]string{
115 ".md": {"{/*", ""},
116 },
117 },
118 exts: extensionConfig{".md", ".md"},
119 content: `
120This is the intro pagragraph.
121
122{/* This is a comment */}
123`,
124 expectedErr: "",
125 },
126 }
127 for _, c := range cases {
128 t.Run(c.description, func(t *testing.T) {
129 _, err := applyPatterns(&c.conf, c.exts, c.content)
130 if !strings.Contains(err.Error(), c.expectedErr) {
131 t.Fatalf("Expected '%s', but got '%s'", c.expectedErr, err.Error())
132 }
133 })
134 }
135}
136
137// TODO: Test for expected errors resulting from applyPatterns

Callers

nothing calls this directly

Calls 3

applyPatternsFunction · 0.85
ContainsMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…