diff options
Diffstat (limited to 'storage/test/storage_suite.go')
-rw-r--r-- | storage/test/storage_suite.go | 14 |
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{} |