aboutsummaryrefslogtreecommitdiffstats
path: root/storage/test/storage_suite.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-12-15 13:45:52 +0100
committerGitHub <noreply@github.com>2016-12-15 13:45:52 +0100
commit249c4137f4f34992c9bb6a60954e30a27994add7 (patch)
tree1188a410d368c619548d74798c474e04469eabae /storage/test/storage_suite.go
parentf01fd176ff61a3f37d096939690aa103de054ecc (diff)
downloadgo-git-249c4137f4f34992c9bb6a60954e30a27994add7.tar.gz
storage: shallow storage (#180)
* storage: shallow storage * changes * changes
Diffstat (limited to 'storage/test/storage_suite.go')
-rw-r--r--storage/test/storage_suite.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go
index 9d63ff8..bf0d10d 100644
--- a/storage/test/storage_suite.go
+++ b/storage/test/storage_suite.go
@@ -17,6 +17,7 @@ import (
type Storer interface {
storer.EncodedObjectStorer
storer.ReferenceStorer
+ storer.ShallowStorer
config.ConfigStorer
}
@@ -263,6 +264,21 @@ func (s *BaseStorageSuite) TestIterReferences(c *C) {
c.Assert(err, Equals, io.EOF)
}
+func (s *BaseStorageSuite) TestSetShallowAndShallow(c *C) {
+ expected := []plumbing.Hash{
+ plumbing.NewHash("b66c08ba28aa1f81eb06a1127aa3936ff77e5e2c"),
+ plumbing.NewHash("c3f4688a08fd86f1bf8e055724c84b7a40a09733"),
+ plumbing.NewHash("c78874f116be67ecf54df225a613162b84cc6ebf"),
+ }
+
+ err := s.Storer.SetShallow(expected)
+ c.Assert(err, IsNil)
+
+ result, err := s.Storer.Shallow()
+ c.Assert(err, IsNil)
+ c.Assert(result, DeepEquals, expected)
+}
+
func (s *BaseStorageSuite) TestSetConfigAndConfig(c *C) {
expected := config.NewConfig()
expected.Core.IsBare = true