From 0282bcf15109c67c0304c032cb5f9748d6427ff7 Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Wed, 14 Oct 2020 23:51:47 +0300 Subject: [PATCH] [Tests] Add a test for opening very short file as a zip --- Tests/ZipTests.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/ZipTests.swift b/Tests/ZipTests.swift index 4abeddb5..69fd3ec6 100644 --- a/Tests/ZipTests.swift +++ b/Tests/ZipTests.swift @@ -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))