Moddy the Tube test
This commit is contained in:
parent
e8551f5d02
commit
0a27fc1f9b
|
|
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user