tests/micropython: Test loading const objs in native and viper funcs.
This commit is contained in:
parent
2e86233263
commit
ac81cee3fc
|
@ -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()())
|
|
@ -0,0 +1,2 @@
|
|||
b'bytes'
|
||||
123
|
|
@ -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()())
|
|
@ -0,0 +1,2 @@
|
|||
b'bytes'
|
||||
123
|
|
@ -0,0 +1,7 @@
|
|||
# check loading constants
|
||||
|
||||
@micropython.viper
|
||||
def f():
|
||||
return 123456789012345678901234567890
|
||||
|
||||
print(f())
|
|
@ -0,0 +1 @@
|
|||
123456789012345678901234567890
|
Loading…
Reference in New Issue