diff options
author | Damien George <damien@micropython.org> | 2021-01-18 00:29:18 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-01-29 23:57:10 +1100 |
commit | 7a97e4351b4d78f64c3d1fbecd497481e649a83f (patch) | |
tree | c55269dfa095a93542d93945fda1e386ba3ef7c2 /tests/micropython/native_for.py | |
parent | c9f4c5acd6278a7a8f3376867d2927efd00aefa6 (diff) |
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>
Diffstat (limited to 'tests/micropython/native_for.py')
-rw-r--r-- | tests/micropython/native_for.py | 19 |
1 files changed, 19 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)) |