Moddy the Tube test

This commit is contained in:
numzero 2024-06-28 22:34:16 +03:00
parent e8551f5d02
commit 0a27fc1f9b

View File

@ -49,8 +49,14 @@ impl Metric for Tube {
} }
} }
#[test] #[cfg(test)]
fn test_tube_metric_derivs() { mod test {
use glam::{Vec2, vec2};
use crate::riemann::{Decomp2, Metric};
use super::Tube;
#[test]
fn test_tube_metric_derivs() {
struct Approx(Tube); struct Approx(Tube);
impl Metric for Approx { impl Metric for Approx {
fn sqrt_at(&self, pos: Vec2) -> Decomp2 { self.0.sqrt_at(pos) } fn sqrt_at(&self, pos: Vec2) -> Decomp2 { self.0.sqrt_at(pos) }
@ -74,4 +80,5 @@ fn test_tube_metric_derivs() {
assert!(eq, "Bad derivative computation at {pos}:\n explicit: {computed:?}\n numerical: {reference:?}\n"); assert!(eq, "Bad derivative computation at {pos}:\n explicit: {computed:?}\n numerical: {reference:?}\n");
} }
} }
}
} }