We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a0c5d2 commit 6f6fddcCopy full SHA for 6f6fddc
iter/chain_test.go
@@ -5,6 +5,7 @@ import (
5
"testing"
6
7
"github.com/BooleanCat/go-functional/internal/assert"
8
+ "github.com/BooleanCat/go-functional/internal/fakes"
9
"github.com/BooleanCat/go-functional/iter"
10
)
11
@@ -32,3 +33,14 @@ func TestChainSingle(t *testing.T) {
32
33
func TestChainEmpty(t *testing.T) {
34
assert.True(t, iter.Chain[int]().Next().IsNone())
35
}
36
+
37
+func TestChainExhausted(t *testing.T) {
38
+ firstFake := new(fakes.FakeIterator[int])
39
+ secondFake := new(fakes.FakeIterator[int])
40
+ iter := iter.Chain[int](firstFake, secondFake)
41
42
+ assert.True(t, iter.Next().IsNone())
43
44
+ assert.Equal(t, firstFake.NextCallCount(), 1)
45
+ assert.Equal(t, secondFake.NextCallCount(), 1)
46
+}
0 commit comments