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

Function TestLocalComplete

cmd/vale/pkg_test.go:117–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestLocalComplete(t *testing.T) { //nolint:dupl
118 path, err := mockPath()
119 if err != nil {
120 t.Fatal(err)
121 }
122
123 zip, err := filepath.Abs(filepath.Join(TestData, "ISC.zip"))
124 if err != nil {
125 t.Fatal(err)
126 }
127
128 err = readPkg(zip, path, 0)
129 if err != nil {
130 t.Fatal(err)
131 }
132
133 if !system.IsDir(filepath.Join(path, "ISC")) {
134 t.Fatal("unable to find 'ISC' in StylesPath")
135 }
136
137 vocab := filepath.Join(path, "Vocab", "ISC_General", "accept.txt")
138 if !system.FileExists(vocab) {
139 t.Fatal("unable to find 'ISC_General' in Vocab")
140 }
141
142 b, err := os.ReadFile(vocab)
143 if err != nil {
144 t.Fatal(err)
145 }
146 lines := strings.Split(string(b), "\n")
147
148 if !core.StringInSlice("bar", lines) {
149 t.Fatalf("unable to find 'bar' in %v", lines)
150 }
151}
152
153func TestLocalOnlyStyles(t *testing.T) { //nolint:dupl
154 path, err := mockPath()

Callers

nothing calls this directly

Calls 5

IsDirFunction · 0.92
FileExistsFunction · 0.92
StringInSliceFunction · 0.92
mockPathFunction · 0.85
readPkgFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…