aboutsummaryrefslogtreecommitdiffstats
path: root/storage/test/storage_suite.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 16:24:07 +0100
committerGitHub <noreply@github.com>2017-01-30 16:24:07 +0100
commita24e40af0aa2d9d512051269993a1b08c0496d12 (patch)
tree65936a6a365263c93e4b57c3b67aad6a13489e68 /storage/test/storage_suite.go
parenta48bc6e17ef6298f93ec21cdf1a5e387640673b6 (diff)
parent35378e7db9288e8244f2634a1b47981606731cef (diff)
downloadgo-git-a24e40af0aa2d9d512051269993a1b08c0496d12.tar.gz
Merge pull request #229 from mcuadros/worktree
Worktree and new Repository Contructors
Diffstat (limited to 'storage/test/storage_suite.go')
-rw-r--r--storage/test/storage_suite.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go
index bf0d10d..ca2f783 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,27 @@ func (s *BaseStorageSuite) TestSetConfigAndConfig(c *C) {
c.Assert(cfg, DeepEquals, expected)
}
+func (s *BaseStorageSuite) TestIndex(c *C) {
+ expected := &index.Index{}
+ expected.Version = 2
+
+ idx, err := s.Storer.Index()
+ c.Assert(err, IsNil)
+ c.Assert(idx, 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{}