diff options
Diffstat (limited to 'tests/micropython')
-rw-r--r-- | tests/micropython/native_for.py | 19 | ||||
-rw-r--r-- | tests/micropython/native_for.py.exp | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/micropython/native_for.py b/tests/micropython/native_for.py new file mode 100644 index 000000000..c640a8d08 --- /dev/null +++ b/tests/micropython/native_for.py @@ -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)) diff --git a/tests/micropython/native_for.py.exp b/tests/micropython/native_for.py.exp new file mode 100644 index 000000000..d4dc73eff --- /dev/null +++ b/tests/micropython/native_for.py.exp @@ -0,0 +1,8 @@ +0 +1 +2 +3 +0 +1 +2 +3 |