tests/micropython: Test loading const objs in native and viper funcs.
This commit is contained in:
parent
2e86233263
commit
ac81cee3fc
14
tests/micropython/native_const.py
Normal file
14
tests/micropython/native_const.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# test loading constants in native functions
|
||||||
|
|
||||||
|
@micropython.native
|
||||||
|
def f():
|
||||||
|
return b'bytes'
|
||||||
|
print(f())
|
||||||
|
|
||||||
|
@micropython.native
|
||||||
|
def f():
|
||||||
|
@micropython.native
|
||||||
|
def g():
|
||||||
|
return 123
|
||||||
|
return g
|
||||||
|
print(f()())
|
2
tests/micropython/native_const.py.exp
Normal file
2
tests/micropython/native_const.py.exp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
b'bytes'
|
||||||
|
123
|
14
tests/micropython/viper_const.py
Normal file
14
tests/micropython/viper_const.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# test loading constants in viper functions
|
||||||
|
|
||||||
|
@micropython.viper
|
||||||
|
def f():
|
||||||
|
return b'bytes'
|
||||||
|
print(f())
|
||||||
|
|
||||||
|
@micropython.viper
|
||||||
|
def f():
|
||||||
|
@micropython.viper
|
||||||
|
def g() -> int:
|
||||||
|
return 123
|
||||||
|
return g
|
||||||
|
print(f()())
|
2
tests/micropython/viper_const.py.exp
Normal file
2
tests/micropython/viper_const.py.exp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
b'bytes'
|
||||||
|
123
|
7
tests/micropython/viper_const_intbig.py
Normal file
7
tests/micropython/viper_const_intbig.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# check loading constants
|
||||||
|
|
||||||
|
@micropython.viper
|
||||||
|
def f():
|
||||||
|
return 123456789012345678901234567890
|
||||||
|
|
||||||
|
print(f())
|
1
tests/micropython/viper_const_intbig.py.exp
Normal file
1
tests/micropython/viper_const_intbig.py.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
123456789012345678901234567890
|
Loading…
Reference in New Issue
Block a user