• Home
  • Raw
  • Download

Lines Matching refs:t

49 func TestMockFs_followSymlinks(t *testing.T) {
97 t.Run(test.from, func(t *testing.T) {
100 t.Errorf("want: %v, got %v", test.to, got)
106 func runTestFs(t *testing.T, f func(t *testing.T, fs FileSystem, dir string)) {
111 run := func(t *testing.T, fs FileSystem) {
112 t.Run("relpath", func(t *testing.T) {
113 f(t, fs, "")
115 t.Run("abspath", func(t *testing.T) {
116 f(t, fs, absTestDataDir)
120 t.Run("mock", func(t *testing.T) {
121 f(t, mock, "")
124 t.Run("os", func(t *testing.T) {
127 run(t, OsFs)
130 t.Run("os relative srcDir", func(t *testing.T) {
131 run(t, NewOsFs(testdataDir))
134 t.Run("os absolute srcDir", func(t *testing.T) {
137 run(t, NewOsFs(filepath.Join(wd, testdataDir)))
142 func TestFs_IsDir(t *testing.T) {
189 runTestFs(t, func(t *testing.T, fs FileSystem, dir string) {
191 t.Run(test.name, func(t *testing.T) {
193 checkErr(t, test.err, err)
195 t.Errorf("want: %v, got %v", test.isDir, got)
202 func TestFs_ListDirsRecursiveFollowSymlinks(t *testing.T) {
231 runTestFs(t, func(t *testing.T, fs FileSystem, dir string) {
233 t.Run(test.name, func(t *testing.T) {
235 checkErr(t, test.err, err)
241 t.Errorf("want: %v, got %v", want, got)
248 func TestFs_ListDirsRecursiveDontFollowSymlinks(t *testing.T) {
277 runTestFs(t, func(t *testing.T, fs FileSystem, dir string) {
279 t.Run(test.name, func(t *testing.T) {
281 checkErr(t, test.err, err)
287 t.Errorf("want: %v, got %v", want, got)
294 func TestFs_Readlink(t *testing.T) {
340 runTestFs(t, func(t *testing.T, fs FileSystem, dir string) {
342 t.Run(test.from, func(t *testing.T) {
344 checkErr(t, test.err, err)
346 t.Errorf("fs.Readlink(%q) want: %q, got %q", test.from, test.to, got)
353 func TestFs_Lstat(t *testing.T) {
401 runTestFs(t, func(t *testing.T, fs FileSystem, dir string) {
403 t.Run(test.name, func(t *testing.T) {
405 checkErr(t, test.err, err)
410 t.Errorf("fs.Lstat(%q).Mode()&os.ModeType want: %x, got %x",
414 t.Errorf("fs.Lstat(%q).Size() want: %d, got %d", test.name, test.size, got.Size())
421 func TestFs_Stat(t *testing.T) {
469 runTestFs(t, func(t *testing.T, fs FileSystem, dir string) {
471 t.Run(test.name, func(t *testing.T) {
473 checkErr(t, test.err, err)
478 t.Errorf("fs.Stat(%q).Mode()&os.ModeType want: %x, got %x",
482 t.Errorf("fs.Stat(%q).Size() want: %d, got %d", test.name, test.size, got.Size())
489 func TestMockFs_glob(t *testing.T) {
527 runTestFs(t, func(t *testing.T, fs FileSystem, dir string) {
529 t.Run(test.pattern, func(t *testing.T) {
532 t.Fatal(err)
535 t.Errorf("want: %v, got %v", test.files, got)
552 func checkErr(t *testing.T, want, got error) {
553 t.Helper()
555 t.Fatalf("want: %v, got %v", want, got)
566 t.Fatalf("want: %v, got %v", want, got)