Faster, but less than ideal, large file compression as well as start byte GC.

This commit is contained in:
Jennifer Taylor
2020-11-12 05:03:33 +00:00
parent 88042a7e9e
commit 41ea293897
2 changed files with 72 additions and 20 deletions

View File

@@ -53,6 +53,16 @@ class TestLz77RealCompressor(unittest.TestCase):
decompresseddata = lz77.decompress(compresseddata)
self.assertEqual(data, decompresseddata)
def test_huge_data_random(self) -> None:
lz77 = Lz77()
data = bytes([random.randint(0, 255) for _ in range(1 * 1024 * 1024)])
compresseddata = lz77.compress(data)
self.assertNotEqual(data, compresseddata)
decompresseddata = lz77.decompress(compresseddata)
self.assertEqual(data, decompresseddata)
def test_declaration(self) -> None:
lz77 = Lz77()
data = get_fixture("declaration.txt")