From 7877ad9e352f59e617121d15ea86016d98aaf1dd Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Wed, 20 Oct 2021 15:02:26 +0300 Subject: [PATCH] [Tests] Add lz4 test for even smaller input --- Tests/LZ4CompressionTests.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/LZ4CompressionTests.swift b/Tests/LZ4CompressionTests.swift index d3056df3..d551c21a 100644 --- a/Tests/LZ4CompressionTests.swift +++ b/Tests/LZ4CompressionTests.swift @@ -27,6 +27,7 @@ class LZ4CompressionTests: XCTestCase { } func testLZ4CompressStrings() throws { + try stringTest("ban") try stringTest("banana") try stringTest("abaaba") try stringTest("abracadabra") @@ -160,6 +161,7 @@ class LZ4CompressionTests: XCTestCase { func testTrickySequence() throws { // This test helped us find an issue with implementation (match index was wrongly used as cyclical index). + // The last 10 bytes (0x01 - 0x00) are only here to allow creation of a sequence with a match. let answerData = Data([0x61, 0x6C, 0x20, 0x2D, 0x43, 0x20, 0x2D, 0x43, 0x20, 0x2D, 0x2D, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00]) let compressedData = LZ4.compress(data: answerData, independentBlocks: false, blockChecksums: true,