diff options
Diffstat (limited to 'tests/micropython')
| -rw-r--r-- | tests/micropython/viper.py | 20 | ||||
| -rw-r--r-- | tests/micropython/viper.py.exp | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/micropython/viper.py b/tests/micropython/viper.py new file mode 100644 index 000000000..e1c04784d --- /dev/null +++ b/tests/micropython/viper.py @@ -0,0 +1,20 @@ +import micropython + +# viper function taking and returning ints +@micropython.viper +def f(x:int, y:int) -> int: + return x + y + 3 + +# viper function taking and returning objects +@micropython.viper +def g(x:object, y:object) -> object: + return x + y + +# this doesn't work at the moment +#@micropython.viper +#def g() -> uint: +# return -1 + +print(f(1, 2)) +print(g(1, 2)) +#print(h()) diff --git a/tests/micropython/viper.py.exp b/tests/micropython/viper.py.exp new file mode 100644 index 000000000..7ea2ad9b2 --- /dev/null +++ b/tests/micropython/viper.py.exp @@ -0,0 +1,2 @@ +6 +3 |
