mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
tests: Add test for semantics of for-loop that optimisation can break.
This commit is contained in:
11
tests/basics/for3.py
Normal file
11
tests/basics/for3.py
Normal 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
|
||||
Reference in New Issue
Block a user