Skip to content

Commit d752721

Browse files
committed
fixup! float: Use a shared assert_biteq! macro for tests
1 parent 9f9ac74 commit d752721

File tree

1 file changed

+3
-2
lines changed
  • library/coretests/tests/floats

1 file changed

+3
-2
lines changed

library/coretests/tests/floats/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ macro_rules! assert_biteq {
2828

2929
// Hack to get the width from a value
3030
let bits = (l.to_bits() - l.to_bits()).leading_zeros();
31+
let nl = if stringify!($($tt)*).is_empty() { "" } else { "\n" };
3132
assert!(
3233
l.to_bits() == r.to_bits(),
33-
"{}\nl: {l:?} ({lb:#0width$x})\nr: {r:?} ({rb:#0width$x})",
34-
format_args!($($tt)*),
34+
"{msg}{nl}l: {l:?} ({lb:#0width$x})\nr: {r:?} ({rb:#0width$x})",
35+
msg = format_args!($($tt)*),
3536
lb = l.to_bits(),
3637
rb = r.to_bits(),
3738
width = ((bits / 4) + 2) as usize,

0 commit comments

Comments
 (0)