aboutsummaryrefslogtreecommitdiffstats
path: root/storage/test
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-28 16:26:14 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-28 16:26:14 +0100
commit9a9f2b1f63a98fad67a3190ef813428b68dfdd8c (patch)
treec7266ab8a010d551670d9f6356294c09ffa9f7fb /storage/test
parent24c1878260351d9f9f6c575cbeeb5878104d6a0e (diff)
downloadgo-git-9a9f2b1f63a98fad67a3190ef813428b68dfdd8c.tar.gz
storage: IndexStorer implementation
Diffstat (limited to 'storage/test')
-rw-r--r--storage/test/storage_suite.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go
index bf0d10d..088edce 100644
--- a/storage/test/storage_suite.go
+++ b/storage/test/storage_suite.go
@@ -9,6 +9,7 @@ import (
"gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing"
+ "gopkg.in/src-d/go-git.v4/plumbing/format/index"
"gopkg.in/src-d/go-git.v4/plumbing/storer"
. "gopkg.in/check.v1"
@@ -18,6 +19,7 @@ type Storer interface {
storer.EncodedObjectStorer
storer.ReferenceStorer
storer.ShallowStorer
+ storer.IndexStorer
config.ConfigStorer
}
@@ -295,6 +297,18 @@ func (s *BaseStorageSuite) TestSetConfigAndConfig(c *C) {
c.Assert(cfg, DeepEquals, expected)
}
+func (s *BaseStorageSuite) TestSetIndexAndIndex(c *C) {
+ expected := &index.Index{}
+ expected.Version = 2
+
+ err := s.Storer.SetIndex(expected)
+ c.Assert(err, IsNil)
+
+ idx, err := s.Storer.Index()
+ c.Assert(err, IsNil)
+ c.Assert(idx, DeepEquals, expected)
+}
+
func (s *BaseStorageSuite) TestSetConfigInvalid(c *C) {
cfg := config.NewConfig()
cfg.Remotes["foo"] = &config.RemoteConfig{}