MCPcopy
hub / github.com/bitfield/script / TestFindFiles_RecursesIntoSubdirectories

Function TestFindFiles_RecursesIntoSubdirectories

script_test.go:1306–1322  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1304}
1305
1306func TestFindFiles_RecursesIntoSubdirectories(t *testing.T) {
1307 t.Parallel()
1308 p := script.FindFiles("testdata/multiple_files_with_subdirectory")
1309 if p.Error() != nil {
1310 t.Fatal(p.Error())
1311 }
1312 p.SetError(nil) // else p.String() would be a no-op
1313 // Expect result to use this platform's path separator
1314 want := filepath.Clean("testdata/multiple_files_with_subdirectory/1.txt\ntestdata/multiple_files_with_subdirectory/2.txt\ntestdata/multiple_files_with_subdirectory/3.tar.zip\ntestdata/multiple_files_with_subdirectory/dir/.hidden\ntestdata/multiple_files_with_subdirectory/dir/1.txt\ntestdata/multiple_files_with_subdirectory/dir/2.txt\n")
1315 got, err := p.String()
1316 if err != nil {
1317 t.Fatal(err)
1318 }
1319 if !cmp.Equal(want, got) {
1320 t.Fatal(cmp.Diff(want, got))
1321 }
1322}
1323
1324func TestFindFiles_InNonexistentPathReturnsError(t *testing.T) {
1325 t.Parallel()

Callers

nothing calls this directly

Calls 4

FindFilesFunction · 0.92
ErrorMethod · 0.80
SetErrorMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…