-
Notifications
You must be signed in to change notification settings - Fork 8
/
LargeZipTests.java
36 lines (31 loc) · 946 Bytes
/
LargeZipTests.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package software.coley.lljzip;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.file.Paths;
/**
* Tests that reading larger strings from zip files works correctly.
*/
public class LargeZipTests {
@Test
public void testLargeStrings() {
try {
ZipIO.readStandard(Paths.get("src/test/resources/sample-long-name.zip"));
} catch (IOException error) {
Assertions.fail(error);
}
}
// Left this test out for obvious reasons, all you need to run it is a zip file containing a single file >2.1GB
/*
@Test
public void testLargeFiles() {
try {
ZipArchive zip = ZipIO.readStandard(Paths.get("src/test/resources/large.zip"));
// Just need a file bigger than 2.1GB to validate this test works
Assertions.assertTrue(zip.getLocalFiles().get(0).getFileData().length() > 0x80000000L);
} catch (IOException error) {
Assertions.fail(error);
}
}
*/
}