mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 05:00:26 +01:00
tests: Move native for test from pybnative to micropython.
And make it generic so it can be run on any target. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
19
tests/micropython/native_for.py
Normal file
19
tests/micropython/native_for.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# test for native for loops
|
||||
|
||||
|
||||
@micropython.native
|
||||
def f1(n):
|
||||
for i in range(n):
|
||||
print(i)
|
||||
|
||||
|
||||
f1(4)
|
||||
|
||||
|
||||
@micropython.native
|
||||
def f2(r):
|
||||
for i in r:
|
||||
print(i)
|
||||
|
||||
|
||||
f2(range(4))
|
||||
Reference in New Issue
Block a user