File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,10 @@ func TestIntegerInspect(t *testing.T) {
5959
6060func TestIntegerIteratable (t * testing.T ) {
6161 int1 := object .NewInteger (3 )
62+ int1Iterator := int1 .GetIterator ()
6263
6364 for expected := int64 (0 ); expected < 3 ; expected ++ {
64- _ , value , ok := int1 .Next ()
65+ _ , value , ok := int1Iterator .Next ()
6566 actual := value .(* object.Integer )
6667
6768 if ! ok {
@@ -77,14 +78,14 @@ func TestIntegerIteratable(t *testing.T) {
7778 }
7879 }
7980
80- _ , _ , ok := int1 .Next ()
81+ _ , _ , ok := int1Iterator .Next ()
8182 if ok {
8283 t .Errorf ("integer iteration didn't finish" )
8384 }
8485
85- int1 .Reset ()
86- _ , _ , ok = int1 .Next ()
86+ int1Iterator = int1 .GetIterator ()
87+ _ , _ , ok = int1Iterator .Next ()
8788 if ! ok {
88- t .Errorf ("integer iteration shouldn't finish after reset " )
89+ t .Errorf ("new integer iteration shouldn't finish after first next " )
8990 }
9091}
You can’t perform that action at this time.
0 commit comments