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

pull/4194/head
Damien George 2018-09-27 23:37:33 +10:00
rodzic 2e86233263
commit ac81cee3fc
6 zmienionych plików z 40 dodań i 0 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -0,0 +1 @@
123456789012345678901234567890