diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-02-17 00:24:31 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-02-17 11:46:00 +0100 |
commit | a964e32d92c53a47ce7c46d589a18c62133b8c50 (patch) | |
tree | 4c094cd6afb95cb2832f866b9411276418435819 /formats/packfile/reader_test.go | |
parent | 1ac00554c3b5f88d2ddc2e28e7cfcdcad9d9f4bb (diff) | |
download | go-git-a964e32d92c53a47ce7c46d589a18c62133b8c50.tar.gz |
storages: memory object
Diffstat (limited to 'formats/packfile/reader_test.go')
-rw-r--r-- | formats/packfile/reader_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/formats/packfile/reader_test.go b/formats/packfile/reader_test.go index f460614..69069c8 100644 --- a/formats/packfile/reader_test.go +++ b/formats/packfile/reader_test.go @@ -10,6 +10,7 @@ import ( "time" "gopkg.in/src-d/go-git.v2/core" + "gopkg.in/src-d/go-git.v2/storages/memory" "github.com/dustin/go-humanize" . "gopkg.in/check.v1" @@ -29,7 +30,7 @@ func (s *ReaderSuite) TestReadPackfile(c *C) { r := NewReader(d) - storage := core.NewRAWObjectStorage() + storage := memory.NewObjectStorage() _, err := r.Read(storage) c.Assert(err, IsNil) @@ -63,7 +64,7 @@ func (s *ReaderSuite) testReadPackfileGitFixture(c *C, file string, f Format) { r := NewReader(d) r.Format = f - storage := core.NewRAWObjectStorage() + storage := memory.NewObjectStorage() _, err = r.Read(storage) c.Assert(err, IsNil) @@ -99,7 +100,7 @@ func (s *ReaderSuite) testReadPackfileGitFixture(c *C, file string, f Format) { }) } -func AssertObjects(c *C, s *core.RAWObjectStorage, expects []string) { +func AssertObjects(c *C, s *memory.ObjectStorage, expects []string) { c.Assert(len(expects), Equals, len(s.Objects)) for _, expected := range expects { obtained, err := s.Get(core.NewHash(expected)) @@ -174,14 +175,14 @@ func (s *ReaderSuite) _TestMemoryREF(c *C) { fmt.Println("time", time.Since(start)) } -func readFromFile(c *C, file string, f Format) *core.RAWObjectStorage { +func readFromFile(c *C, file string, f Format) *memory.ObjectStorage { d, err := os.Open(file) c.Assert(err, IsNil) r := NewReader(d) r.Format = f - storage := core.NewRAWObjectStorage() + storage := memory.NewObjectStorage() _, err = r.Read(storage) c.Assert(err, IsNil) |