referrerpolicy=no-referrer-when-downgrade

Macro sp_runtime::assert_eq_error_rate

source ·
macro_rules! assert_eq_error_rate {
    ($x:expr, $y:expr, $error:expr $(,)?) => { ... };
}
Expand description

Checks that $x is equal to $y with an error rate of $error.

§Example

sp_runtime::assert_eq_error_rate!(10, 10, 0);
sp_runtime::assert_eq_error_rate!(10, 11, 1);
sp_runtime::assert_eq_error_rate!(12, 10, 2);
sp_runtime::assert_eq_error_rate!(12, 10, 1);