@@ -37,6 +37,10 @@ func TestIteratorFromRevertSlice(t *testing.T) {
3737 assert .True (t , it .Next ())
3838 assert .Equal (t , 2 , it .Value ())
3939
40+ cloned := it .Clone ().RequireValue ()
41+ assert .True (t , cloned .Next ())
42+ assert .Equal (t , 3 , cloned .Value ())
43+
4044 assert .True (t , it .Next ())
4145 assert .Equal (t , 1 , it .Value ())
4246
@@ -86,6 +90,10 @@ func TestIteratorWithTransform(t *testing.T) {
8690 assert .True (t , it .Next ())
8791 assert .Equal (t , "2" , it .Value ())
8892
93+ cloned := it .Clone ().RequireValue ()
94+ assert .True (t , cloned .Next ())
95+ assert .Equal (t , "1" , cloned .Value ())
96+
8997 assert .True (t , it .Next ())
9098 assert .Equal (t , "3" , it .Value ())
9199
@@ -96,7 +104,7 @@ func TestIteratorWithFilter(t *testing.T) {
96104 t .Parallel ()
97105
98106 it := iterator .WithFilter (
99- iterator .FromSlice ([]int {1 , 2 , 3 , 4 , 5 }),
107+ iterator .FromSlice ([]int {1 , 2 , 3 , 4 , 5 , 6 }),
100108 func (i int ) bool {
101109 return i % 2 == 0
102110 },
@@ -107,5 +115,12 @@ func TestIteratorWithFilter(t *testing.T) {
107115 assert .True (t , it .Next ())
108116 assert .Equal (t , 4 , it .Value ())
109117
118+ cloned := it .Clone ().RequireValue ()
119+ assert .True (t , cloned .Next ())
120+ assert .Equal (t , 2 , cloned .Value ())
121+
122+ assert .True (t , it .Next ())
123+ assert .Equal (t , 6 , it .Value ())
124+
110125 assert .False (t , it .Next ())
111126}
0 commit comments