add tests for min and max from Float

This commit is contained in:
Daniel Micay 2014-03-05 17:18:56 -05:00
parent 8a55cd988f
commit 5973b0c4ad
2 changed files with 24 additions and 0 deletions

View File

@ -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);

View File

@ -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);