diff options
| author | Igor Tolmachev <me@igorek.dev> | 2024-06-27 00:22:52 +0900 |
|---|---|---|
| committer | Igor Tolmachev <me@igorek.dev> | 2024-06-27 00:22:52 +0900 |
| commit | a867677218c1d55dadfcac1ca5b8cd32a78a3c28 (patch) | |
| tree | 563133b148e29a0521401103a53f1ba0912765d2 /tests/zip.rs | |
| parent | 18b613fc0b63cb6e5a9b408ef7f47da8f153d6c6 (diff) | |
| download | archivator-a867677218c1d55dadfcac1ca5b8cd32a78a3c28.tar.gz archivator-a867677218c1d55dadfcac1ca5b8cd32a78a3c28.zip | |
Implement file getter in archive
Diffstat (limited to 'tests/zip.rs')
| -rw-r--r-- | tests/zip.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/zip.rs b/tests/zip.rs new file mode 100644 index 0000000..65244c1 --- /dev/null +++ b/tests/zip.rs | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | use archivator::{Archive, Zip}; | ||
| 2 | |||
| 3 | #[test] | ||
| 4 | fn test_zip() { | ||
| 5 | let archive = Archive::<Zip<_>>::read_from_file("tests/files/zip.zip").unwrap(); | ||
| 6 | |||
| 7 | assert_eq!(archive.comment(), "archive comment"); | ||
| 8 | assert_eq!( | ||
| 9 | archive | ||
| 10 | .files() | ||
| 11 | .iter() | ||
| 12 | .map(|f| &f.name) | ||
| 13 | .collect::<Vec<&String>>(), | ||
| 14 | vec!["a", "b", "c"] | ||
| 15 | ); | ||
| 16 | } | ||
