Expand description
Shared test utilities for ustar crates.
This crate provides common testing functionality including support for gzip-compressed snapshot files, test data management, and mock HTTP clients for testing download functionality.
Structs§
- Mock
Http Client - Mock HTTP client for testing with pre-recorded responses
- Snapshot
Mismatch - Result of a snapshot check - either Ok or a mismatch with details
Functions§
- assert_
snapshot_ gz - Custom assertion that works with zstd compressed snapshots.
Works like
insta::assert_snapshot!but reads from.snap.zstfiles. Panics on mismatch - usecheck_snapshot_gzif you need to collect multiple failures. - check_
snapshot_ gz - Check a snapshot without panicking. Returns Ok(()) if the snapshot matches, or Err(SnapshotMismatch) if there’s a mismatch. Creates .snap.new and .snap.diff files on mismatch for later review/acceptance.
- ensure_
test_ data_ available - Ensure test data is available and verified
- read_
snapshot - Read a snapshot file, automatically decompressing if it’s zstd compressed Returns the FULL file content including headers
- verify_
test_ data_ checksums - Verify checksums for all files in a test data directory