fix macro

This commit is contained in:
Mike Dilger 2015-01-01 10:41:07 +13:00
parent 4c1cfb03cf
commit 122c95f2b4
1 changed files with 2 additions and 2 deletions

View File

@ -18,11 +18,11 @@ macro_rules! assert_approx_eq_eps(
#[macro_export]
macro_rules! assert_approx_eq_ulps(
($given: expr, $expected: expr, $ulps: expr) => ({
let ulps = &($ulps);
let ulps = $ulps;
let (given_val, expected_val) = (&($given), &($expected));
if !ApproxEq::approx_eq_ulps(given_val, expected_val, ulps) {
panic!("assertion failed: `left ≈ right` (left: `{}`, right: `{}`, tolerance: `{}`)",
*given_val, *expected_val, *ulps
*given_val, *expected_val, ulps
)
}
})