Skip to content

Commit

Permalink
better formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cytadela8 committed Sep 27, 2024
1 parent 408fba4 commit 68e8b2d
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions core/lib/external_price_api/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,21 @@ pub(crate) mod tests {
}

#[test]
fn test_zero_panics() {
fn test_to_fraction_bad_inputs() {
assert_eq!(
get_fraction(0.0).expect_err("did not error").to_string(),
"numerator is zero"
);
}

#[test]
fn test_negative() {
assert_eq!(
get_fraction(-1.0).expect_err("did not error").to_string(),
"number is negative"
);
}

#[test]
fn test_nan() {
assert_eq!(
get_fraction(f64::NAN)
.expect_err("did not error")
.to_string(),
"number is not rational"
);
}

#[test]
fn test_infinity() {
assert_eq!(
get_fraction(f64::INFINITY)
.expect_err("did not error")
Expand Down

0 comments on commit 68e8b2d

Please sign in to comment.