mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os: improve Readdir test coverage, fix Readdir(0) on EOF
Adds tests for Readdir and Readdirnames with different n values. No good way to inject faults during full reads, though. Also fixes bug report from fshahriar: Readdir(0) wasn't behaving like Readdir(-1). R=rsc, fshahriar CC=golang-dev https://golang.org/cl/4529092
This commit is contained in:
parent
0b204e4625
commit
0e865ab8e7
2 changed files with 66 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ func (f *File) Readdirnames(n int) (names []string, err Error) {
|
|||
f.dirinfo.buf = make([]byte, blockSize)
|
||||
}
|
||||
d := f.dirinfo
|
||||
wantAll := n < 0
|
||||
wantAll := n <= 0
|
||||
|
||||
size := n
|
||||
if size < 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue