aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2021-03-12 15:45:18 +0000
committerJosh Bleecher Snyder <josharian@gmail.com>2021-03-12 16:00:02 +0000
commit9289c120025be6fef3a27732229a38df3ebf47c7 (patch)
tree6f49c73133518e0efe614ac3613e14c1c3858156 /src/testing
parente8b82789cda6c9d9e3dfc9a652b4d7a823b834f2 (diff)
downloadgo-9289c120025be6fef3a27732229a38df3ebf47c7.tar.gz
go-9289c120025be6fef3a27732229a38df3ebf47c7.zip
Revert "testing/fstest: test that ReadDirFile on a non-dir fails"
This reverts commit 1853411d8376570295711f9084d494d458822578. Reason for revert: broke plan 9 builder. fixes #44967 Change-Id: Ib89448d37f7ab8bb05dbd89ce744431d807eb4da Reviewed-on: https://go-review.googlesource.com/c/go/+/301190 Reviewed-by: Bryan C. Mills <bcmills@google.com> Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/fstest/testfs.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/testing/fstest/testfs.go b/src/testing/fstest/testfs.go
index 27c603167f..e0ad60a17b 100644
--- a/src/testing/fstest/testfs.go
+++ b/src/testing/fstest/testfs.go
@@ -119,9 +119,6 @@ func (t *fsTester) openDir(dir string) fs.ReadDirFile {
t.errorf("%s: Open: %v", dir, err)
return nil
}
- // It'd be nice to test here that f.Read fails, because f is a directory.
- // However, FreeBSD supports calling read on a directory.
- // See https://groups.google.com/g/golang-dev/c/rh8jwxyG1PQ.
d, ok := f.(fs.ReadDirFile)
if !ok {
f.Close()
@@ -517,12 +514,6 @@ func (t *fsTester) checkFile(file string) {
return
}
- if dir, ok := f.(fs.ReadDirFile); ok {
- if _, err := dir.ReadDir(-1); err == nil {
- t.errorf("%s: ReadDir of non-dir file should return an error", file)
- }
- }
-
data, err := ioutil.ReadAll(f)
if err != nil {
f.Close()