tests/micropython: Test loading const objs in native and viper funcs.

This commit is contained in:
Damien George 2018-09-27 23:37:33 +10:00
parent 2e86233263
commit ac81cee3fc
6 changed files with 40 additions and 0 deletions

View 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()())

View File

@ -0,0 +1,2 @@
b'bytes'
123

View 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()())

View File

@ -0,0 +1,2 @@
b'bytes'
123

View File

@ -0,0 +1,7 @@
# check loading constants
@micropython.viper
def f():
return 123456789012345678901234567890
print(f())

View File

@ -0,0 +1 @@
123456789012345678901234567890