Skip to content

Commit

Permalink
Add test case for multiple decompression
Browse files Browse the repository at this point in the history
  • Loading branch information
gwangyong-lee committed Jun 13, 2022
1 parent 63abded commit bdd44ab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/GzipTests/GzipTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@ final class GzipTests: XCTestCase {
XCTAssertTrue(data.isGzipped)
XCTAssertEqual(String(data: uncompressed, encoding: .utf8), "test")
}


func testMultipleDecompression() throws {
let firstData = try "test".data(using: .utf8)!.gzipped()
let secondData = try "string".data(using: .utf8)!.gzipped()

let data = firstData + secondData

let uncompressed = try data.gunzipped()

XCTAssertTrue(data.isGzipped)
XCTAssertEqual(String(data: uncompressed, encoding: .utf8), "teststring")
}

}

Expand Down

0 comments on commit bdd44ab

Please sign in to comment.