macro_rules! assert_always_or_unreachable { ($condition:expr, $message:literal$(, $details:expr)?) => { ... }; ($($rest:tt)*) => { ... }; }
Expand description
Assert that condition
is true every time this function is called. The corresponding test property will pass even if the assertion is never encountered.
This test property will be viewable in the Antithesis SDK: Always
group of your triage report.
§Example
use serde_json::{json};
use antithesis_sdk::{assert_always_or_unreachable, random};
const MAX_ALLOWED: u64 = 100;
let actual = random::get_random() % 100u64;
let details = json!({"max_allowed": MAX_ALLOWED, "actual": actual});
antithesis_sdk::assert_always_or_unreachable!(actual < MAX_ALLOWED, "Value in range", &details);