cleanup: share the integration-test key fixture in tests/common

The 32-byte test key "0123456789abcdef0123456789abcdef" was hardcoded
in three places: src/crypto.rs unit tests, tests/roundtrip.rs, and
tests/library_api.rs - three copies to keep in sync if the fixture
ever changes.

Add tests/common/mod.rs exposing the KEY bytes and a test_key()
SecretBytes32 constructor; roundtrip.rs and library_api.rs now pull
from it. The unit tests in src/crypto.rs cannot reach an
integration-test module and keep their own copy.

The module carries #![allow(dead_code)] because each test crate
compiles its own copy and none uses every fixture.

Test-only change.

Test plan: cargo test passes all suites (43 CLI roundtrip tests,
2 library_api tests, 13 unit tests).
This commit is contained in:
2026-06-12 22:55:50 +02:00
parent 7f49d034ae
commit 792f2f174b
3 changed files with 24 additions and 7 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ use std::{
use assert_cmd::cargo::CommandCargoExt;
use tempfile::TempDir;
const KEY: &[u8; 32] = b"0123456789abcdef0123456789abcdef";
mod common;
use common::KEY;
fn fcry() -> Command {
Command::cargo_bin("fcry").unwrap()