tests: Add test for semantics of for-loop that optimisation can break.

This commit is contained in:
Damien George 2014-12-11 17:40:41 +00:00
parent c33ce606cf
commit 5fba93a26b
1 changed files with 11 additions and 0 deletions

11
tests/basics/for3.py Normal file
View File

@ -0,0 +1,11 @@
# test assigning to iterator within the loop
for i in range(2):
print(i)
i = 2
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
#n = 2
#for i in range(n):
# print(i)
# n = 0