fix macro
This commit is contained in:
parent
4c1cfb03cf
commit
122c95f2b4
|
@ -18,11 +18,11 @@ macro_rules! assert_approx_eq_eps(
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! assert_approx_eq_ulps(
|
macro_rules! assert_approx_eq_ulps(
|
||||||
($given: expr, $expected: expr, $ulps: expr) => ({
|
($given: expr, $expected: expr, $ulps: expr) => ({
|
||||||
let ulps = &($ulps);
|
let ulps = $ulps;
|
||||||
let (given_val, expected_val) = (&($given), &($expected));
|
let (given_val, expected_val) = (&($given), &($expected));
|
||||||
if !ApproxEq::approx_eq_ulps(given_val, expected_val, ulps) {
|
if !ApproxEq::approx_eq_ulps(given_val, expected_val, ulps) {
|
||||||
panic!("assertion failed: `left ≈ right` (left: `{}`, right: `{}`, tolerance: `{}`)",
|
panic!("assertion failed: `left ≈ right` (left: `{}`, right: `{}`, tolerance: `{}`)",
|
||||||
*given_val, *expected_val, *ulps
|
*given_val, *expected_val, ulps
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue