MCPcopy
hub / github.com/git-lfs/git-lfs / TestFastWalkBasic

Function TestFastWalkBasic

tools/filetools_test.go:190–208  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

188}
189
190func TestFastWalkBasic(t *testing.T) {
191 wd, err := os.Getwd()
192 assert.NoError(t, err)
193
194 rootDir := t.TempDir()
195 os.Chdir(rootDir)
196 defer os.Chdir(wd)
197
198 expectedEntries := createFastWalkInputData(10, 160)
199
200 walker := fastWalkWithExcludeFiles(expectedEntries[0])
201 gotEntries, gotErrors := collectFastWalkResults(walker.ch)
202
203 assert.Empty(t, gotErrors)
204
205 sort.Strings(expectedEntries)
206 sort.Strings(gotEntries)
207 assert.Equal(t, expectedEntries, gotEntries)
208}
209
210// Make test data - ensure you've Chdir'ed into a temp dir first
211// Returns list of files/dirs that are created

Callers

nothing calls this directly

Calls 5

createFastWalkInputDataFunction · 0.85
fastWalkWithExcludeFilesFunction · 0.85
collectFastWalkResultsFunction · 0.85
TempDirMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected