Skip to content

Commit

Permalink
add tests for min and max from Float
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Mar 6, 2014
1 parent 8a55cd9 commit 5973b0c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libstd/num/f32.rs
Expand Up @@ -866,6 +866,18 @@ mod tests {
use num::*;
use num;

#[test]
fn test_min_nan() {
assert_eq!(NAN.min(2.0), 2.0);
assert_eq!(2.0f32.min(NAN), 2.0);
}

#[test]
fn test_max_nan() {
assert_eq!(NAN.max(2.0), 2.0);
assert_eq!(2.0f32.max(NAN), 2.0);
}

#[test]
fn test_num() {
num::test_num(10f32, 2f32);
Expand Down
12 changes: 12 additions & 0 deletions src/libstd/num/f64.rs
Expand Up @@ -865,6 +865,18 @@ mod tests {
use num::*;
use num;

#[test]
fn test_min_nan() {
assert_eq!(NAN.min(2.0), 2.0);
assert_eq!(2.0f64.min(NAN), 2.0);
}

#[test]
fn test_max_nan() {
assert_eq!(NAN.max(2.0), 2.0);
assert_eq!(2.0f64.max(NAN), 2.0);
}

#[test]
fn test_num() {
num::test_num(10f64, 2f64);
Expand Down

0 comments on commit 5973b0c

Please sign in to comment.