diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/pkg/os/os_unix_test.go | |
parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
download | golang-upstream/1.3.tar.gz |
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'src/pkg/os/os_unix_test.go')
-rw-r--r-- | src/pkg/os/os_unix_test.go | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/src/pkg/os/os_unix_test.go b/src/pkg/os/os_unix_test.go index b0fc0256d..21d40ccaf 100644 --- a/src/pkg/os/os_unix_test.go +++ b/src/pkg/os/os_unix_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd +// +build darwin dragonfly freebsd linux netbsd openbsd solaris package os_test @@ -74,41 +74,3 @@ func TestChown(t *testing.T) { checkUidGid(t, f.Name(), int(sys.Uid), gid) } } - -func TestReaddirWithBadLstat(t *testing.T) { - handle, err := Open(sfdir) - failfile := sfdir + "/" + sfname - if err != nil { - t.Fatalf("Couldn't open %s: %s", sfdir, err) - } - - *LstatP = func(file string) (FileInfo, error) { - if file == failfile { - var fi FileInfo - return fi, ErrInvalid - } - return Lstat(file) - } - defer func() { *LstatP = Lstat }() - - dirs, err := handle.Readdir(-1) - if err != nil { - t.Fatalf("Expected Readdir to return no error, got %v", err) - } - foundfail := false - for _, dir := range dirs { - if dir.Name() == sfname { - foundfail = true - if dir.Sys() != nil { - t.Errorf("Expected Readdir for %s should not contain Sys", failfile) - } - } else { - if dir.Sys() == nil { - t.Errorf("Readdir for every file other than %s should contain Sys, but %s/%s didn't either", failfile, sfdir, dir.Name()) - } - } - } - if !foundfail { - t.Fatalf("Expected %s from Readdir, but didn't find it", failfile) - } -} |