Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 406bff1

Browse files
committed
move tests to separate #[cfg(test)] mod
1 parent c04293d commit 406bff1

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/math/round.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ pub fn round(mut x: f64) -> f64 {
3636
}
3737
}
3838

39-
#[test]
40-
fn negative_zero() {
41-
assert_eq!(round(-0.0_f64).to_bits(), (-0.0_f64).to_bits());
39+
#[cfg(test)]
40+
mod tests {
41+
use super::round;
42+
43+
#[test]
44+
fn negative_zero() {
45+
assert_eq!(round(-0.0_f64).to_bits(), (-0.0_f64).to_bits());
46+
}
4247
}

src/math/roundf.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ pub fn roundf(mut x: f32) -> f32 {
3434
}
3535
}
3636

37-
#[test]
38-
fn negative_zero() {
39-
assert_eq!(roundf(-0.0_f32).to_bits(), (-0.0_f32).to_bits());
37+
#[cfg(test)]
38+
mod tests {
39+
use super::roundf;
40+
41+
#[test]
42+
fn negative_zero() {
43+
assert_eq!(roundf(-0.0_f32).to_bits(), (-0.0_f32).to_bits());
44+
}
4045
}

0 commit comments

Comments
 (0)