aboutsummaryrefslogtreecommitdiffstats
path: root/core/object_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-23 16:18:54 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-23 16:18:54 +0200
commit11a24261b21f5f0e9e8304bcbb4a0b27ff5cbbb5 (patch)
treea9980da45676fd307cfc9ad5fd222d049909b34d /core/object_test.go
parenta8c0b15da2f628efb304bc1d9aa79b49144f98a1 (diff)
downloadgo-git-11a24261b21f5f0e9e8304bcbb4a0b27ff5cbbb5.tar.gz
fix tag iter test
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 {