diff --git a/tests/extmod/uzlib_decompio.py b/tests/extmod/uzlib_decompio.py new file mode 100644 index 0000000000..ee3204d07c --- /dev/null +++ b/tests/extmod/uzlib_decompio.py @@ -0,0 +1,19 @@ +try: + import zlib +except ImportError: + import uzlib as zlib +import uio as io + + +# Raw DEFLATE bitstream +buf = io.BytesIO(b'\xcbH\xcd\xc9\xc9\x07\x00') +inp = zlib.DecompIO(buf) +print(buf.seek(0, 1)) +print(inp.read(1)) +print(buf.seek(0, 1)) +print(inp.read(2)) +print(inp.read()) +print(buf.seek(0, 1)) +print(inp.read(1)) +print(inp.read()) +print(buf.seek(0, 1)) diff --git a/tests/extmod/uzlib_decompio.py.exp b/tests/extmod/uzlib_decompio.py.exp new file mode 100644 index 0000000000..6ef811d7db --- /dev/null +++ b/tests/extmod/uzlib_decompio.py.exp @@ -0,0 +1,9 @@ +0 +b'h' +2 +b'el' +b'lo' +7 +b'' +b'' +7