We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f539a53 commit 939f08aCopy full SHA for 939f08a
Tests/BZip2Tests.swift
@@ -67,6 +67,13 @@ class BZip2Tests: XCTestCase {
67
XCTAssertThrowsError(try BZip2.decompress(data: testData))
68
}
69
70
+ func testBadFile_truncated() throws {
71
+ // This tests that encountering data truncated in the middle of a Huffman symbol correctly throws an error
72
+ // (and doesn't crash).
73
+ let testData = try Constants.data(forTest: "test1", withType: BZip2Tests.testType)[0...40]
74
+ XCTAssertThrowsError(try BZip2.decompress(data: testData))
75
+ }
76
+
77
func testEmptyData() throws {
78
XCTAssertThrowsError(try BZip2.decompress(data: Data()))
79
0 commit comments