macro_rules! assert_always_some {
({$($($name:ident: $cond:expr),+ $(,)?)?}, $message:expr$(, $details:expr)?) => { ... };
($($rest:tt)*) => { ... };
}Expand description
assert_always_some({a: x, b: y, ...}) is similar to assert_always(x || y || ...), except:
- Antithesis has more visibility to the individual propositions.
- There is no short-circuiting, so all of
x,y, … would be evaluated. - The assertion details would be merged with
{"a": x, "b": y, ...}.
Ensure that non-const-evaluable messages are rejected.
use serde_json::json;
const MESSAGE: &str = concat!("at least ", "one");
antithesis_sdk::assert_always_some!({a: true, b: false}, MESSAGE, &json!({}));ⓘ
use serde_json::json;
antithesis_sdk::assert_always_some!({a: true, b: false}, format!("{}", "at least one"), &json!({}));