aboutsummaryrefslogtreecommitdiffstats
path: root/formats/objfile/reader_test.go
diff options
context:
space:
mode:
authorJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-27 14:07:22 -0800
committerJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-27 14:07:22 -0800
commit31f920a06aa5d7e7cf363645dac02f6e798fffb1 (patch)
treeddd60f794c193e1a407e78b5ca94d0a83466fd78 /formats/objfile/reader_test.go
parente6855829c4df2861e779adcccbb422e7c0830afd (diff)
downloadgo-git-31f920a06aa5d7e7cf363645dac02f6e798fffb1.tar.gz
Improved objfile error handling and test coverage
Diffstat (limited to 'formats/objfile/reader_test.go')
-rw-r--r--formats/objfile/reader_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/formats/objfile/reader_test.go b/formats/objfile/reader_test.go
index 871eefe..caebb60 100644
--- a/formats/objfile/reader_test.go
+++ b/formats/objfile/reader_test.go
@@ -35,9 +35,12 @@ func testReader(c *C, source io.Reader, hash core.Hash, typ core.ObjectType, con
rc, err := ioutil.ReadAll(r)
c.Assert(err, IsNil)
c.Assert(rc, DeepEquals, content, Commentf("%scontent=%s, expected=%s", base64.StdEncoding.EncodeToString(rc), base64.StdEncoding.EncodeToString(content)))
+ c.Assert(r.Size(), Equals, int64(len(content)))
c.Assert(r.Hash(), Equals, hash) // Test Hash() before close
c.Assert(r.Close(), IsNil)
c.Assert(r.Hash(), Equals, hash) // Test Hash() after close
+ _, err = r.Read(make([]byte, 0, 1))
+ c.Assert(err, Equals, ErrClosed)
}
func (s *SuiteReader) TestReadEmptyObjfile(c *C) {