[Tests] Add a test for opening very short file as a zip

This commit is contained in:
Timofey Solomko
2020-10-15 23:35:18 +03:00
parent fa552e9b61
commit 0282bcf151
+4
View File
@@ -10,6 +10,10 @@ class ZipTests: XCTestCase {
private static let testType: String = "zip"
func testBadFile_short() {
XCTAssertThrowsError(try ZipContainer.open(container: Data([0, 1, 2, 3, 4, 5, 6, 7])))
}
func testBadFile_invalid() throws {
let testData = try Constants.data(forAnswer: "test6")
XCTAssertThrowsError(try ZipContainer.open(container: testData))