Skip to content

Commit

Permalink
Use only one assert
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 authored and marco-c committed Jul 11, 2022
1 parent 09ef915 commit c7e1fb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ macro_rules! check_metrics {

$(
$(
if !($true_float_value as f64).is_nan() {
assert!(func_space.metrics.$metric.$func_float().total_cmp(&$true_float_value) == std::cmp::Ordering::Equal);
assert!(if ($true_float_value as f64).is_nan() {
func_space.metrics.$metric.$func_float().is_nan()
} else {
assert!(func_space.metrics.$metric.$func_float().is_nan());
}
func_space.metrics.$metric.$func_float().total_cmp(&$true_float_value) == std::cmp::Ordering::Equal
});
)*
)?
}
Expand Down

0 comments on commit c7e1fb4

Please sign in to comment.