kopia lustrzana https://github.com/micropython/micropython
tests/ports/unix: Add coverage test for frozen functions and generators.
Signed-off-by: Damien George <damien@micropython.org>pull/13628/head
rodzic
a3a73b64a3
commit
5a3dd8c791
|
@ -0,0 +1,16 @@
|
||||||
|
# Test importing frozen functions.
|
||||||
|
|
||||||
|
# A simple bytecode function with no children.
|
||||||
|
def f():
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
print(__name__, f())
|
||||||
|
|
||||||
|
|
||||||
|
# A simple bytecode generator with no children.
|
||||||
|
def g():
|
||||||
|
yield 2
|
||||||
|
|
||||||
|
|
||||||
|
print(__name__, next(g()))
|
|
@ -87,6 +87,9 @@ except ZeroDivisionError:
|
||||||
# test importing various objects
|
# test importing various objects
|
||||||
import frzmpy3
|
import frzmpy3
|
||||||
|
|
||||||
|
# test importing other things
|
||||||
|
import frzmpy4
|
||||||
|
|
||||||
# test for MP_QSTR_NULL regression
|
# test for MP_QSTR_NULL regression
|
||||||
from frzqstr import returns_NULL
|
from frzqstr import returns_NULL
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,8 @@ ZeroDivisionError
|
||||||
X
|
X
|
||||||
'\x1b'
|
'\x1b'
|
||||||
b'\x00\xff'
|
b'\x00\xff'
|
||||||
|
frzmpy4 1
|
||||||
|
frzmpy4 2
|
||||||
NULL
|
NULL
|
||||||
uPy
|
uPy
|
||||||
a long string that is not interned
|
a long string that is not interned
|
||||||
|
|
Ładowanie…
Reference in New Issue