aboutsummaryrefslogtreecommitdiffstats
path: root/core/object_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/object_test.go')
-rw-r--r--core/object_test.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/core/object_test.go b/core/object_test.go
index 08c5dd2..d087aae 100644
--- a/core/object_test.go
+++ b/core/object_test.go
@@ -1,6 +1,10 @@
package core
-import . "gopkg.in/check.v1"
+import (
+ "fmt"
+
+ . "gopkg.in/check.v1"
+)
type ObjectSuite struct{}
@@ -137,6 +141,18 @@ func (s *ObjectSuite) TestObjectSliceIterStop(c *C) {
c.Assert(err, IsNil)
}
+func (s *ObjectSuite) TestObjectSliceIterError(c *C) {
+ i := NewObjectSliceIter([]Object{
+ &MemoryObject{h: NewHash("4921e391f1128010a2d957f8db15c5e729ccf94a")},
+ })
+
+ err := i.ForEach(func(Object) error {
+ return fmt.Errorf("a random error")
+ })
+
+ c.Assert(err, NotNil)
+}
+
type MockObjectStorage struct{}
func (o *MockObjectStorage) NewObject() Object {