[][src]Macro sp_runtime::assert_eq_error_rate

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

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);
This example panics
sp_runtime::assert_eq_error_rate!(12, 10, 1);