Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
make tests also except EOF error
Browse files Browse the repository at this point in the history
  • Loading branch information
keks committed Apr 26, 2017
1 parent 8cd78b7 commit 80cbd2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ 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 {
t.Fatal("Expected to be able to read 4 bytes")
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 {
t.Fatal("Expected to be able to close file")
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 == nil || err == io.EOF) {
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

0 comments on commit 80cbd2e

Please sign in to comment.