Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit a4278c1

Browse files
committed
plumbing/packfile: test UpdateObjectStorage empty packfile error
Signed-off-by: Javi Fontan <jfontan@gmail.com>
1 parent fdc18d6 commit a4278c1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

plumbing/format/packfile/common_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
package packfile
22

33
import (
4+
"bytes"
45
"testing"
56

67
"gopkg.in/src-d/go-git.v4/plumbing"
8+
"gopkg.in/src-d/go-git.v4/storage/memory"
79

810
. "gopkg.in/check.v1"
911
)
1012

1113
func Test(t *testing.T) { TestingT(t) }
1214

15+
type CommonSuite struct{}
16+
17+
var _ = Suite(&CommonSuite{})
18+
19+
func (s *CommonSuite) TestEmptyUpdateObjectStorage(c *C) {
20+
var buf bytes.Buffer
21+
sto := memory.NewStorage()
22+
23+
err := UpdateObjectStorage(sto, &buf)
24+
c.Assert(err, Equals, ErrEmptyPackfile)
25+
}
26+
1327
func newObject(t plumbing.ObjectType, cont []byte) plumbing.EncodedObject {
1428
o := plumbing.MemoryObject{}
1529
o.SetType(t)

0 commit comments

Comments
 (0)