From 7b366f7df4d3705dec19a70e0f2da3ba93fa5c35 Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Tue, 24 Feb 2026 00:50:23 +0800 Subject: [PATCH] [Tests] Add a more comprehensive LZ4 truncation test --- Tests/LZ4Tests.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/LZ4Tests.swift b/Tests/LZ4Tests.swift index 4a591f14..698f4514 100644 --- a/Tests/LZ4Tests.swift +++ b/Tests/LZ4Tests.swift @@ -202,4 +202,15 @@ class LZ4Tests: XCTestCase { } } + func testLZ4Truncation() throws { + for i in 1...9 { + let testName = "test\(i)" + let testData = try Constants.data(forTest: testName, withType: LZ4Tests.testType) + for _ in 0..<100 { + let truncationIndex = Int.random(in: (testData.startIndex + 1)..