File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
graalpython/com.oracle.graal.python.test/src/tests Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -355,3 +355,28 @@ def __index__(self):
355
355
356
356
a .insert (False , - 1 )
357
357
self .assertEqual ([- 1 ,0 ,1 ], a )
358
+
359
+ def testStopIteration (self ):
360
+ l = [1.0 ]
361
+ i = l .__iter__ ()
362
+ i .__next__ ()
363
+ self .assertRaises (StopIteration , i .__next__ )
364
+ l .append (2.0 )
365
+ self .assertRaises (StopIteration , i .__next__ )
366
+ l .append ('a' )
367
+ self .assertRaises (StopIteration , i .__next__ )
368
+
369
+ l = []
370
+ i = l .__iter__ ()
371
+ self .assertRaises (StopIteration , i .__next__ )
372
+ l .append (2.0 )
373
+ self .assertRaises (StopIteration , i .__next__ )
374
+
375
+ l = ['a' ]
376
+ i = l .__iter__ ()
377
+ i .__next__ ()
378
+ self .assertRaises (StopIteration , i .__next__ )
379
+ l .append ('b' )
380
+ self .assertRaises (StopIteration , i .__next__ )
381
+ l .append (3 )
382
+ self .assertRaises (StopIteration , i .__next__ )
You can’t perform that action at this time.
0 commit comments