Skip to main content

turso_assert_sometimes

Macro turso_assert_sometimes 

Source
turso_assert_sometimes!() { /* proc-macro */ }
Expand description

Observational assertion: tells Antithesis that a condition should be true at least once across all test runs. Never panics.

Maps to antithesis_sdk::assert_sometimes!.

§Behavior

  • Without antithesis feature: evaluates the condition expression (preserving any side effects) but discards the result. Effectively a no-op.
  • With antithesis feature: reports to Antithesis via assert_sometimes!. Antithesis will flag it if the condition is never true across the entire test campaign, indicating the fuzzer failed to explore that state.

This macro never panics or exits — it is purely observational.

§Parameters

  • condition — boolean expression to observe.
  • "message" (optional) — human-readable description.
  • { "key": value, ... } (optional) — structured details for Antithesis.

§Usage

turso_assert_sometimes!(condition);
turso_assert_sometimes!(condition, "message");
turso_assert_sometimes!(condition, "message", { "key": value });

§When to use

Use turso_assert_sometimes! to verify the fuzzer explores both branches of a condition. For example, if a cache can be either hit or miss, place a turso_assert_sometimes! on each branch to ensure Antithesis tests both paths.