mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 02:48:27 +00:00
Move test closer to code under test
This commit is contained in:
parent
f165c25faa
commit
ad06804675
@ -271,28 +271,6 @@ mod tests {
|
|||||||
Core,
|
Core,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn half_edge_has_no_sibling() -> anyhow::Result<()> {
|
|
||||||
let mut core = Core::new();
|
|
||||||
|
|
||||||
let valid = Shell::tetrahedron(
|
|
||||||
[[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]],
|
|
||||||
&mut core,
|
|
||||||
);
|
|
||||||
let invalid = valid.shell.remove_face(&valid.abc.face);
|
|
||||||
|
|
||||||
valid
|
|
||||||
.shell
|
|
||||||
.validate_and_return_first_error(&core.layers.geometry)?;
|
|
||||||
assert_contains_err!(
|
|
||||||
core,
|
|
||||||
invalid,
|
|
||||||
ValidationError::HalfEdgeHasNoSibling { .. }
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn coincident_half_edges_are_not_siblings() -> anyhow::Result<()> {
|
fn coincident_half_edges_are_not_siblings() -> anyhow::Result<()> {
|
||||||
let mut core = Core::new();
|
let mut core = Core::new();
|
||||||
|
@ -72,3 +72,37 @@ impl ValidationCheck<Shell> for HalfEdgeHasNoSibling {
|
|||||||
.map(|half_edge| HalfEdgeHasNoSibling { half_edge })
|
.map(|half_edge| HalfEdgeHasNoSibling { half_edge })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use crate::{
|
||||||
|
assert_contains_err,
|
||||||
|
operations::{build::BuildShell, update::UpdateShell},
|
||||||
|
topology::Shell,
|
||||||
|
validate::Validate,
|
||||||
|
validation::ValidationError,
|
||||||
|
Core,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn half_edge_has_no_sibling() -> anyhow::Result<()> {
|
||||||
|
let mut core = Core::new();
|
||||||
|
|
||||||
|
let valid = Shell::tetrahedron(
|
||||||
|
[[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]],
|
||||||
|
&mut core,
|
||||||
|
);
|
||||||
|
let invalid = valid.shell.remove_face(&valid.abc.face);
|
||||||
|
|
||||||
|
valid
|
||||||
|
.shell
|
||||||
|
.validate_and_return_first_error(&core.layers.geometry)?;
|
||||||
|
assert_contains_err!(
|
||||||
|
core,
|
||||||
|
invalid,
|
||||||
|
ValidationError::HalfEdgeHasNoSibling { .. }
|
||||||
|
);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user