diff options
Diffstat (limited to 'core/object_test.go')
-rw-r--r-- | core/object_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/object_test.go b/core/object_test.go new file mode 100644 index 0000000..c9f4f2c --- /dev/null +++ b/core/object_test.go @@ -0,0 +1,31 @@ +package core + +import . "gopkg.in/check.v1" + +type ObjectSuite struct{} + +var _ = Suite(&ObjectSuite{}) + +func (s *ObjectSuite) TestMultiObjectIterNext(c *C) { + expected := []Object{ + &MemoryObject{}, + &MemoryObject{}, + &MemoryObject{}, + &MemoryObject{}, + &MemoryObject{}, + &MemoryObject{}, + } + + iter := NewMultiObjectIter([]ObjectIter{ + NewObjectSliceIter(expected[0:2]), + NewObjectSliceIter(expected[2:4]), + NewObjectSliceIter(expected[4:5]), + }) + + var i int + iter.ForEach(func(o Object) error { + c.Assert(o, Equals, expected[i]) + i++ + return nil + }) +} |