move tests to separate #[cfg(test)] mod

This commit is contained in:
Igor null
2019-07-01 17:23:52 +03:00
parent c04293d8b8
commit 406bff1844
2 changed files with 16 additions and 6 deletions
+8 -3
View File
@@ -36,7 +36,12 @@ pub fn round(mut x: f64) -> f64 {
}
}
#[test]
fn negative_zero() {
assert_eq!(round(-0.0_f64).to_bits(), (-0.0_f64).to_bits());
#[cfg(test)]
mod tests {
use super::round;
#[test]
fn negative_zero() {
assert_eq!(round(-0.0_f64).to_bits(), (-0.0_f64).to_bits());
}
}
+8 -3
View File
@@ -34,7 +34,12 @@ pub fn roundf(mut x: f32) -> f32 {
}
}
#[test]
fn negative_zero() {
assert_eq!(roundf(-0.0_f32).to_bits(), (-0.0_f32).to_bits());
#[cfg(test)]
mod tests {
use super::roundf;
#[test]
fn negative_zero() {
assert_eq!(roundf(-0.0_f32).to_bits(), (-0.0_f32).to_bits());
}
}