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

Function Test_applyPatterns

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

Source from the content-addressed store, hash-verified

8)
9
10func Test_applyPatterns(t *testing.T) {
11 cases := []struct {
12 description string
13 conf core.Config
14 exts extensionConfig
15 content string
16 expected string
17 }{
18 {
19 description: "MDX comment in markdown, custom comment delimiter",
20 conf: core.Config{
21 CommentDelimiters: map[string][2]string{
22 ".md": {"{/*", "*/}"},
23 },
24 },
25 exts: extensionConfig{".md", ".md"},
26 content: `
27This is the intro pagragraph.
28
29{/* This is a comment */}
30`,
31 expected: strings.ReplaceAll(`
32This is the intro pagragraph.
33
34<!-- This is a comment -->
35`, "@", "`"),
36 },
37 {
38 description: "MDX comment in markdown, no custom comment delimiter",
39 conf: core.Config{},
40 exts: extensionConfig{".md", ".md"},
41 content: `
42This is the intro pagragraph.
43
44{/* This is a comment */}
45`,
46 expected: strings.ReplaceAll(`
47This is the intro pagragraph.
48
49{/* This is a comment */}
50`, "@", "`"),
51 },
52 {
53 description: "multiline MDX comment in markdown, custom comment delimiter",
54 conf: core.Config{
55 CommentDelimiters: map[string][2]string{
56 ".md": {"{/*", "*/}"},
57 },
58 },
59 exts: extensionConfig{".md", ".md"},
60 content: `
61This is the intro pagragraph.
62
63{/*
64This is a comment
65*/}
66`,
67 expected: strings.ReplaceAll(`

Callers

nothing calls this directly

Calls 2

applyPatternsFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…