diff options
author | Javi Fontan <jfontan@gmail.com> | 2018-12-03 12:38:31 +0100 |
---|---|---|
committer | Javi Fontan <jfontan@gmail.com> | 2018-12-03 12:38:31 +0100 |
commit | a4278c1c081578055c1e4df96aef54257729a100 (patch) | |
tree | f7aa2fc1c67af06a0ff5f53c9fef3fc46f303780 /plumbing/format/packfile/common_test.go | |
parent | fdc18d60b0e0eb7c0df2cdba03e081fee3e7292c (diff) | |
download | go-git-a4278c1c081578055c1e4df96aef54257729a100.tar.gz |
plumbing/packfile: test UpdateObjectStorage empty packfile error
Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'plumbing/format/packfile/common_test.go')
-rw-r--r-- | plumbing/format/packfile/common_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plumbing/format/packfile/common_test.go b/plumbing/format/packfile/common_test.go index 387c0d1..eafc617 100644 --- a/plumbing/format/packfile/common_test.go +++ b/plumbing/format/packfile/common_test.go @@ -1,15 +1,29 @@ package packfile import ( + "bytes" "testing" "gopkg.in/src-d/go-git.v4/plumbing" + "gopkg.in/src-d/go-git.v4/storage/memory" . "gopkg.in/check.v1" ) func Test(t *testing.T) { TestingT(t) } +type CommonSuite struct{} + +var _ = Suite(&CommonSuite{}) + +func (s *CommonSuite) TestEmptyUpdateObjectStorage(c *C) { + var buf bytes.Buffer + sto := memory.NewStorage() + + err := UpdateObjectStorage(sto, &buf) + c.Assert(err, Equals, ErrEmptyPackfile) +} + func newObject(t plumbing.ObjectType, cont []byte) plumbing.EncodedObject { o := plumbing.MemoryObject{} o.SetType(t) |