Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added tests/fixtures/test.zip
Binary file not shown.
57 changes: 57 additions & 0 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,63 @@ fn successfully_list_archive_files() {
);
}

#[test]
fn list_archive_zip() {
let source = std::fs::File::open("tests/fixtures/test.zip").unwrap();

assert_eq!(
list_archive_files(source).unwrap(),
vec![
"content/".to_string(),
"content/first".to_string(),
"content/third".to_string(),
"content/nested/".to_string(),
"content/nested/second".to_string(),
],
"file list inside the archive did not match"
);
}

#[async_std::test]
#[cfg(feature = "futures_support")]
async fn list_archive_zip_futures() {
let source = async_std::fs::File::open("tests/fixtures/test.zip")
.await
.unwrap();

assert_eq!(
futures_support::list_archive_files(source).await.unwrap(),
vec![
"content/".to_string(),
"content/first".to_string(),
"content/third".to_string(),
"content/nested/".to_string(),
"content/nested/second".to_string(),
],
"file list inside the archive did not match"
);
}

#[tokio::test]
#[cfg(feature = "tokio_support")]
async fn list_archive_zip_tokio() {
let source = tokio::fs::File::open("tests/fixtures/test.zip")
.await
.unwrap();

assert_eq!(
tokio_support::list_archive_files(source).await.unwrap(),
vec![
"content/".to_string(),
"content/first".to_string(),
"content/third".to_string(),
"content/nested/".to_string(),
"content/nested/second".to_string(),
],
"file list inside the archive did not match"
);
}

#[async_std::test]
#[cfg(feature = "futures_support")]
async fn successfully_list_archive_files_futures() {
Expand Down