tests/ports/unix: Add coverage test for frozen functions and generators.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
16
ports/unix/variants/coverage/frzmpy/frzmpy4.py
Normal file
16
ports/unix/variants/coverage/frzmpy/frzmpy4.py
Normal file
@@ -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()))
|
||||
Reference in New Issue
Block a user