tbxi/tests/test_lzss.py
Elliot Nunn 5e8532c1ee Bump
2019-05-24 23:08:21 +08:00

14 lines
354 B
Python

from tbxi.slow_lzss import decompress
from tbxi.fast_lzss import compress
import random
def test_random():
the_len = 0
while the_len < 4 * 1024 * 1024:
the_len <<= 1
the_len |= random.choice((1, 0))
tryout = bytes(random.choice(range(256)) for x in range(the_len))
assert decompress(compress(tryout)) == tryout