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

Function TestLocalOnlyStyles

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

Source from the content-addressed store, hash-verified

151}
152
153func TestLocalOnlyStyles(t *testing.T) { //nolint:dupl
154 path, err := mockPath()
155 if err != nil {
156 t.Fatal(err)
157 }
158
159 zip, err := filepath.Abs(filepath.Join(TestData, "OnlyStyles.zip"))
160 if err != nil {
161 t.Fatal(err)
162 }
163
164 err = readPkg(zip, path, 0)
165 if err != nil {
166 t.Fatal(err)
167 }
168
169 if !system.IsDir(filepath.Join(path, "ISC")) {
170 t.Fatal("unable to find 'ISC' in StylesPath")
171 }
172
173 vocab := filepath.Join(path, "Vocab", "ISC_General", "accept.txt")
174 if !system.FileExists(vocab) {
175 t.Fatal("unable to find 'ISC_General' in Vocab")
176 }
177
178 b, err := os.ReadFile(vocab)
179 if err != nil {
180 t.Fatal(err)
181 }
182 lines := strings.Split(string(b), "\n")
183
184 if !core.StringInSlice("bar", lines) {
185 t.Fatalf("unable to find 'bar' in %v", lines)
186 }
187}
188
189func TestV3Pkg(t *testing.T) {
190 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…