Skip to main content

Crate tatara_rust_proptest

Crate tatara_rust_proptest 

Source
Expand description

tatara-rust-proptest — property-based testing primitives.

Three layers of generators + canned property assertions:

  1. L0 generatorsarb_ident, arb_type_ref, arb_ref_kind.
  2. L2 generatorsarb_per_field_spec, arb_per_variant_spec, arb_proc_derive_spec.
  3. Property assertionsprop_validate_is_total, prop_emit_does_not_panic, prop_serde_roundtrips. Each is a closure suitable for proptest!.

Consumers add a single #[test] per Spec that calls one of the prop_* assertions; proptest runs 256 randomized cases.

Functions§

arb_ident
Random valid Rust identifier: starts with [A-Za-z_], body is [A-Za-z0-9_]{0,15}. Excludes the empty string.
arb_per_field_spec
Random PerFieldDeriveSpec — template + trait_name come from arb_ident; optional method_name_template + impl_prelude.
arb_per_variant_spec
arb_proc_derive_spec
arb_ref_kind
arb_type_ref
Recursive TypeRef generator bounded to depth 3.
prop_to_tokens_does_not_panic
Identifier rendering doesn’t panic. Catches bad escape-handling in ToRustTokens impls.
prop_validate_is_total
Totalityvalidate returns a Vec regardless of the input. Calling it twice produces the same Vec. Use to assert the validator is deterministic + total over the Spec space.