Expand description
Public crate API for test‑vector based deterministic testing.
See the README for an end‑to‑end walkthrough. At a glance:
- Use
#[derive(TestVectorSet)]to defineTestValue<…>fields - Parameterize code under test with
TV: TestVector - In tests, wrap functions with
#[test_vec_case]or manually callinitialize_tv_case_from_fileandfinalize_tv_case.
Structs§
- Test
Value - Descriptor for a single test‑vector value.
- Test
VecEnv - Internal environment holding the currently loaded and recorded test vectors.
- Test
Vector Active - Active test‑vector implementation: records, injects, and checks entries.
- Test
VectorNOP - No‑op test‑vector implementation for production or non‑testing code paths.
- TlsEnv
Guard - Drop‑guard that keeps the thread‑local test‑vector environment active.
Enums§
- Test
Mode - Execution mode for test vectors.
- Test
Vector Entry Type - Kind of entry stored in a test vector file.
- Test
Vector File Format - File format used to read/write test vector files.
Traits§
- Test
Vector - Core interface toggling between active (capture/validate) and no‑op behavior.
- Test
Vector Momento - Pluggable serializer/deserializer for a type used in test vectors.
- Test
Vector Set - Helper trait implemented by
#[derive(TestVectorSet)]to construct a struct whose fields areTestValue<…>for the current source location.
Functions§
- finalize_
tv_ case - Finalize the current test‑vector session.
- initialize_
tv_ case_ from_ file - Create a test‑vector session from the given file and mode.
- process_
next_ entry - Low‑level: process the next observed entry.
Type Aliases§
- DynDeserializer
- Erased deserializer used by
TestValue<T>to restore values from test vectors. - DynSerializer
- Erased serializer used by
TestValue<T>to persist values in test vectors.
Attribute Macros§
- test_
vec_ case - Attribute macro for tests that use assert_tv test vectors.
Derive Macros§
- Test
Vector Set - Derive
assert_tv::TestVectorSetfor a struct ofTestValue<…>fields.