diff options
author | Damien George <damien.p.george@gmail.com> | 2016-11-10 22:54:55 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-11-10 22:54:55 +1100 |
commit | 679c0c4c835371552fb0bc9b65a4893ceaaf7471 (patch) | |
tree | 7f50066e7ecdea83b3972e3f303c9d6d331c3682 | |
parent | 0f3388de1ef738772de0c07e6b05969a48681d48 (diff) | |
download | micropython-679c0c4c835371552fb0bc9b65a4893ceaaf7471.tar.gz micropython-679c0c4c835371552fb0bc9b65a4893ceaaf7471.zip |
tests/micropython: Add test for import from within viper function.
-rw-r--r-- | tests/micropython/viper_import.py | 10 | ||||
-rw-r--r-- | tests/micropython/viper_import.py.exp | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/micropython/viper_import.py b/tests/micropython/viper_import.py new file mode 100644 index 0000000000..9878007444 --- /dev/null +++ b/tests/micropython/viper_import.py @@ -0,0 +1,10 @@ +# test import within viper function + +@micropython.viper +def f(): + import micropython + print(micropython.const(1)) + + from micropython import const + print(const(2)) +f() diff --git a/tests/micropython/viper_import.py.exp b/tests/micropython/viper_import.py.exp new file mode 100644 index 0000000000..1191247b6d --- /dev/null +++ b/tests/micropython/viper_import.py.exp @@ -0,0 +1,2 @@ +1 +2 |