diff options
| author | Igor Tolmachev <me@igorek.dev> | 2024-07-16 01:59:53 +0900 |
|---|---|---|
| committer | Igor Tolmachev <me@igorek.dev> | 2024-07-16 01:59:53 +0900 |
| commit | a83767f9fbd51df654901b52bdba7838f6a10bf9 (patch) | |
| tree | e9e2fcfb9975a2c2dd6e65c65fd736a035ea6cae /tests/zip.rs | |
| parent | 2fdbec0525bc2a0839ea649106886cb157507a38 (diff) | |
| download | archivator-a83767f9fbd51df654901b52bdba7838f6a10bf9.tar.gz archivator-a83767f9fbd51df654901b52bdba7838f6a10bf9.zip | |
Add traditional PKWARE decryption.
- Compression and encryption may not work together
- Password check is not yet implemented
- Unoptimized crc32 function
Diffstat (limited to 'tests/zip.rs')
| -rw-r--r-- | tests/zip.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/zip.rs b/tests/zip.rs index 11435aa..4f0c985 100644 --- a/tests/zip.rs +++ b/tests/zip.rs | |||
| @@ -2,6 +2,17 @@ use archivator::{Archive, Zip}; | |||
| 2 | use std::io::{Read, Seek, SeekFrom}; | 2 | use std::io::{Read, Seek, SeekFrom}; |
| 3 | 3 | ||
| 4 | #[test] | 4 | #[test] |
| 5 | fn test_zip_passwd() { | ||
| 6 | let mut archive = Archive::<Zip>::read_from_file("tests/files/archive_passwd.zip").unwrap(); | ||
| 7 | let mut f = archive | ||
| 8 | .get_file_reader_by_index_with_password(0, "passwd") | ||
| 9 | .unwrap(); | ||
| 10 | let mut data = String::new(); | ||
| 11 | f.read_to_string(&mut data).unwrap(); | ||
| 12 | assert_eq!(data, "test file data"); | ||
| 13 | } | ||
| 14 | |||
| 15 | // #[test] | ||
| 5 | fn test_zip() { | 16 | fn test_zip() { |
| 6 | let mut archive = Archive::<Zip>::read_from_file("tests/files/archive.zip").unwrap(); | 17 | let mut archive = Archive::<Zip>::read_from_file("tests/files/archive.zip").unwrap(); |
| 7 | 18 | ||
