move tests to separate #[cfg(test)] mod
This commit is contained in:
+8
-3
@@ -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
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user