Lines Matching refs:err
33 …assertStat := func(t *testing.T, stat os.FileInfo, err error, wantName string, wantMode os.FileMod…
35 if err != nil {
36 t.Error(err)
47 assertErr := func(t *testing.T, err error, wantErr string) {
48 if err == nil || err.Error() != wantErr {
49 t.Errorf("want error %q, got %q", wantErr, err)
53 stat, err := filesystem.Lstat("/tmp/links/dir")
54 assertStat(t, stat, err, "dir", os.ModeSymlink)
56 stat, err = filesystem.Stat("/tmp/links/dir")
57 assertStat(t, stat, err, "realdir", os.ModeDir)
59 stat, err = filesystem.Lstat("/tmp/links/file")
60 assertStat(t, stat, err, "file", os.ModeSymlink)
62 stat, err = filesystem.Stat("/tmp/links/file")
63 assertStat(t, stat, err, "hi.txt", 0)
65 stat, err = filesystem.Lstat("/tmp/links/broken")
66 assertStat(t, stat, err, "broken", os.ModeSymlink)
68 stat, err = filesystem.Stat("/tmp/links/broken")
69 assertErr(t, err, "stat /tmp/links/nothingHere: file does not exist")
71 stat, err = filesystem.Lstat("/tmp/links/recursive")
72 assertStat(t, stat, err, "recursive", os.ModeSymlink)
74 stat, err = filesystem.Stat("/tmp/links/recursive")
75 assertErr(t, err, "read /tmp/links/recursive: too many levels of symbolic links")