aboutsummaryrefslogtreecommitdiffstats
path: root/formats/packfile/parser_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'formats/packfile/parser_test.go')
-rw-r--r--formats/packfile/parser_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/formats/packfile/parser_test.go b/formats/packfile/parser_test.go
index d746b98..2ff2887 100644
--- a/formats/packfile/parser_test.go
+++ b/formats/packfile/parser_test.go
@@ -26,6 +26,20 @@ func (s *ScannerSuite) TestHeader(c *C) {
c.Assert(objects, Equals, uint32(31))
}
+func (s *ScannerSuite) TestNextObjectHeaderWithoutHeader(c *C) {
+ r := fixtures.Basic().One().Packfile()
+ p := NewScanner(r)
+
+ h, err := p.NextObjectHeader()
+ c.Assert(err, IsNil)
+ c.Assert(h, DeepEquals, &expectedHeadersOFS[0])
+
+ version, objects, err := p.Header()
+ c.Assert(err, IsNil)
+ c.Assert(version, Equals, VersionSupported)
+ c.Assert(objects, Equals, uint32(31))
+}
+
func (s *ScannerSuite) TestNextObjectHeaderREFDelta(c *C) {
s.testNextObjectHeader(c, "ref-delta", expectedHeadersREF)
}