Skip to content

Commit

Permalink
Merge pull request #10 from anatawa12/p7zip
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede authored Aug 13, 2023
2 parents da8e1ad + c95a012 commit 321f5ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS: true

- name: Test release build without debug assertions
run: cargo test --release --all-features
run: cargo test --release --all-features -- --include-ignored

- name: Upload proptest regressions
if: failure()
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ exclude = [

[dependencies]

[features]
# feature only for testing. this feature does not have any effect in final binary
__test-7zip = []

[dev-dependencies]
bytemuck = { version = "1.13.1", features = ["derive"] }
proptest = "1.2.0"
Expand Down
10 changes: 5 additions & 5 deletions tests/7zip_compatiblity_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg(feature = "__test-7zip")]
//! This test compresses some random data with deflate64 using p7zip `7z` command and check decompression

use bytemuck::{Pod, Zeroable};
Expand All @@ -10,8 +9,8 @@ use std::io::{Cursor, Read, Seek, SeekFrom, Write};
use std::process::Command;
use tempfile::TempDir;

const TEST_FILE_NAME: &'static str = "test.file";
const TEST_ZIP_NAME: &'static str = "test.zip";
const TEST_FILE_NAME: &str = "test.file";
const TEST_ZIP_NAME: &str = "test.zip";

#[repr(C)]
#[derive(Default, Pod, Copy, Clone, Zeroable)]
Expand Down Expand Up @@ -99,9 +98,10 @@ fn compress_with_7zip(data: &[u8]) -> Vec<u8> {

proptest! {
#[test]
fn decompress_compreesed_with_7zip(source_data in "\\PC{1000,}") {
#[ignore = "requires `p7zip` command line tool"]
fn decompress_compressed_with_7zip(source_data in "\\PC{1000,}") {
let source_data = source_data.as_bytes();
let compressed = compress_with_7zip(&source_data);
let compressed = compress_with_7zip(source_data);

let mut decoder = Deflate64Decoder::new(Cursor::new(compressed));

Expand Down

0 comments on commit 321f5ad

Please sign in to comment.