Macro antithesis_sdk::assert_always

source ·
macro_rules! assert_always {
    ($condition:expr, $message:literal$(, $details:expr)?) => { ... };
    ($($rest:tt)*) => { ... };
}
Expand description

Assert that condition is true every time this function is called, and that it is called at least once. The corresponding 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, 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!(actual < MAX_ALLOWED, "Value in range", &details);