Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(commands): fix EOF failure with Multipart.Read #3804

Merged
merged 1 commit into from
Mar 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions commands/files/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ anotherfile
if file, err := mpf.NextFile(); file != nil || err != ErrNotDirectory {
t.Fatal("Expected a nil file and ErrNotDirectory")
}
if n, err := mpf.Read(buf); n != 4 || err != nil {
if n, err := mpf.Read(buf); n != 4 || err != io.EOF && err != nil {
t.Fatal("Expected to be able to read 4 bytes: ", n, err)
}
if err := mpf.Close(); err != nil {
Expand Down Expand Up @@ -171,7 +171,7 @@ anotherfile
if mpf.FileName() != "dir/nested" {
t.Fatalf("Expected filename to be \"nested\", got %s", mpf.FileName())
}
if n, err := mpf.Read(buf); n != 12 || err != nil {
if n, err := mpf.Read(buf); n != 12 || err != io.EOF && err != nil {
t.Fatalf("expected to be able to read 12 bytes from file: %s (got %d)", err, n)
}
if err := mpf.Close(); err != nil {
Expand Down