Move fns:: test to a submodule
This commit is contained in:
parent
f2e2767156
commit
b4f7a3045b
|
|
@ -627,9 +627,6 @@ impl Tube {
|
|||
mod fns {
|
||||
use crate::FloatExt2;
|
||||
|
||||
#[cfg(test)]
|
||||
use approx::{abs_diff_eq, assert_abs_diff_eq};
|
||||
|
||||
pub struct TubeX {
|
||||
pub min: f32,
|
||||
pub max: f32,
|
||||
|
|
@ -667,9 +664,13 @@ mod fns {
|
|||
pub fn d2u(&self, x: f32) -> f32 { extend_const(x, |x| -2.0 * x.signum() * self.a() * self.root(x).powi(-3), self.external, 0.0) }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use approx::{abs_diff_eq, assert_abs_diff_eq};
|
||||
|
||||
#[test]
|
||||
fn test_tube_y() {
|
||||
let testee = TubeY { internal: 100.0, external: 150.0 };
|
||||
let testee = super::TubeY { internal: 100.0, external: 150.0 };
|
||||
let ε = 1.0e-4f32;
|
||||
let δ = 1.0 / 8.0; // Mathematically, you want this to be small. Computationally, you don’t.
|
||||
let margin = 1.0 / 16.0;
|
||||
|
|
@ -708,6 +709,7 @@ mod fns {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trait FloatExt2 {
|
||||
fn lerp(&self, t: f32) -> f32;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user