blob: c9f4f2c4afe64baeb2af3373371238ef0a1fa8cc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
})
}
|