mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-21 01:51:46 +01:00
Merge pull request #2367 from storytold/perf/2218-zip
zip: consolidate integration test binaries
This commit is contained in:
11 files changed
+26
-18
No files matched your search
File renamed without changes.
File renamed without changes.
+2
-3
@@ -1,9 +1,8 @@
|
||||
#![cfg(feature = "lenient")]
|
||||
// From Craft Anything crates/formats/tests/zip64_end_record_compatibility.rs.
|
||||
use craft_zip::lenient::{self as zip, ZipArchive, ZipError};
|
||||
#[path = "lenient_common/mod.rs"]
|
||||
mod common;
|
||||
use super::common;
|
||||
use common::zip_stored;
|
||||
use craft_zip::lenient::{self as zip, ZipArchive, ZipError};
|
||||
|
||||
fn warning_contains(archive: &ZipArchive, text: &str) -> bool {
|
||||
archive.warnings.iter().any(|warning| warning.contains(text))
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
#![cfg(feature = "lenient")]
|
||||
// From Craft Anything crates/formats/tests/zip64_extra_boundaries.rs.
|
||||
|
||||
#[path = "lenient_common/mod.rs"]
|
||||
mod common;
|
||||
use super::common;
|
||||
use craft_zip::lenient as zip;
|
||||
|
||||
fn archive(extra: &[u8], sentinel: usize) -> Vec<u8> {
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
#![cfg(feature = "lenient")]
|
||||
// From Craft Anything crates/formats/tests/zip_decoded_size.rs.
|
||||
|
||||
#[path = "lenient_common/mod.rs"]
|
||||
mod common;
|
||||
use super::common;
|
||||
use craft_zip::lenient::{self as zip, ZipEntry, ZipError};
|
||||
|
||||
fn deflated(body: &[u8]) -> (Vec<u8>, ZipEntry) {
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
#![cfg(feature = "lenient")]
|
||||
// From Craft Anything crates/formats/tests/zip_directory_bounds.rs.
|
||||
use craft_zip::lenient::{self as zip, ZipError};
|
||||
#[path = "lenient_common/mod.rs"]
|
||||
mod common;
|
||||
use super::common;
|
||||
use common::zip_stored;
|
||||
use craft_zip::lenient::{self as zip, ZipError};
|
||||
|
||||
#[test]
|
||||
fn a_short_declared_entry_is_rejected_before_its_signature_is_checked() {
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
#![cfg(feature = "lenient")]
|
||||
// From Craft Anything crates/formats/tests/zip_entry_detection.rs.
|
||||
use craft_zip::lenient::has_entry as zip_has_entry;
|
||||
#[path = "lenient_common/mod.rs"]
|
||||
mod common;
|
||||
use super::common;
|
||||
use common::zip_stored;
|
||||
use craft_zip::lenient::has_entry as zip_has_entry;
|
||||
|
||||
/// A directory-shaped payload is ordinary file content, not an archive member.
|
||||
#[test]
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
#![cfg(feature = "lenient")]
|
||||
// From Craft Anything crates/formats/tests/zip_split_volumes.rs.
|
||||
use craft_zip::lenient::{self as zip, ZipError};
|
||||
#[path = "lenient_common/mod.rs"]
|
||||
mod common;
|
||||
use super::common;
|
||||
use common::zip_stored;
|
||||
use craft_zip::lenient::{self as zip, ZipError};
|
||||
|
||||
fn assert_split(data: &[u8]) {
|
||||
assert!(matches!(zip::parse(data, 10), Err(ZipError::Unsupported(_))));
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
#![cfg(feature = "lenient")]
|
||||
// From Craft Anything crates/formats/tests/zip_stored_cap.rs.
|
||||
|
||||
#[path = "lenient_common/mod.rs"]
|
||||
mod common;
|
||||
use super::common;
|
||||
use craft_zip::lenient::{self as zip, ZipError};
|
||||
|
||||
#[test]
|
||||
@@ -0,0 +1,15 @@
|
||||
//! The crate's integration tests, linked into one test binary.
|
||||
|
||||
#[path = "../lenient_common/mod.rs"]
|
||||
mod common;
|
||||
|
||||
mod aligned_writer;
|
||||
mod archive;
|
||||
mod lenient_zip64_end_record_compatibility;
|
||||
mod lenient_zip64_extra_boundaries;
|
||||
mod lenient_zip_decoded_size;
|
||||
mod lenient_zip_directory_bounds;
|
||||
mod lenient_zip_entry_detection;
|
||||
mod lenient_zip_split_volumes;
|
||||
mod lenient_zip_stored_cap;
|
||||
mod public_api;
|
||||
File renamed without changes.
Reference in new issue
Block a user