From 47655ccf706c7f0bb016df476336ae82bfdb7dba Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Wed, 14 Oct 2020 23:49:54 +0300 Subject: [PATCH] [Tests] Add a test for a not-a-zip file --- Tests/ZipTests.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/ZipTests.swift b/Tests/ZipTests.swift index baf3a3db..4abeddb5 100644 --- a/Tests/ZipTests.swift +++ b/Tests/ZipTests.swift @@ -10,6 +10,11 @@ class ZipTests: XCTestCase { private static let testType: String = "zip" + func testBadFile_invalid() throws { + let testData = try Constants.data(forAnswer: "test6") + XCTAssertThrowsError(try ZipContainer.open(container: testData)) + } + func testBigContainer() throws { let testData = try Constants.data(forTest: "SWCompressionSourceCode", withType: ZipTests.testType)