aboutsummaryrefslogtreecommitdiffstats
path: root/formats/packfile/decoder_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-09 16:50:35 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-09 16:50:35 +0200
commitf09fb50cb092c241df4c0bd25c6755e6132e473e (patch)
treec67f4cdeacf70a64d00167cceceed7a68a5c9e4a /formats/packfile/decoder_test.go
parent59219f01bbf5f748876258fe5f4648d2cfd4d6e9 (diff)
downloadgo-git-f09fb50cb092c241df4c0bd25c6755e6132e473e.tar.gz
storage: filessytem read multiple packfiles support and index decoding
Diffstat (limited to 'formats/packfile/decoder_test.go')
-rw-r--r--formats/packfile/decoder_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/formats/packfile/decoder_test.go b/formats/packfile/decoder_test.go
index 23fa93a..7baab44 100644
--- a/formats/packfile/decoder_test.go
+++ b/formats/packfile/decoder_test.go
@@ -83,7 +83,21 @@ func (s *ReaderSuite) TestDecodeCRCs(c *C) {
}
c.Assert(int(sum), Equals, 78022211966)
+}
+
+func (s *ReaderSuite) TestReadObjectAt(c *C) {
+ f := fixtures.Basic().One()
+
+ scanner := NewScanner(f.Packfile())
+ storage := memory.NewStorage()
+
+ d := NewDecoder(scanner, storage.ObjectStorage())
+ // the objects at reference 186, is a delta, so should be recall, without
+ // being read before.
+ obj, err := d.ReadObjectAt(186)
+ c.Assert(err, IsNil)
+ c.Assert(obj.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
}
func AssertObjects(c *C, s *memory.Storage, expects []string) {