Skip to main content

Module testing

Module testing 

Source
Expand description

What the tests of the operations share about the model: checking it valid and drawn as its trims say, finding its entities by where they are, the model an editor shows, building a part of a model given and steps run on it one by one, and the model a program builds. Only built for tests: with testing, or in this crate’s own.

Structs§

Cases
The cases of a sweep, as they come: how many built, how many were refused, and every one that went wrong.

Enums§

Outcome
What one case of a sweep came to.

Constants§

GIVEN
The id of the step that gives a part its model, in given_part.

Traits§

Built
Building a program on its own, written in the operations registry makes.

Functions§

apply
What O’s step step with args makes of model, as a program of two steps would build it — the model given, then the step — together with what else the step made: the part, after its one run. For an operation’s tests, which build the model they act on directly.
apply_to_model
The model O’s step step with args leaves of model (see apply): for the tests of an operation that builds on the model.
assert_close
Checks a is within tol of b in every coordinate.
assert_draws_its_trims
Checks every face of part is drawn exactly where its trims say: the triangles the rasterizer draws it with cover, in (u, v), the area its outer boundary encloses less its holes’ — as the rasterizer samples them. A face drawn over a hole it goes around, or leaving a gap, covers more or less. Plain f64, like the rasterizer.
assert_model_valid
Checks model is a valid manifold model, failing with every validation error’s root message.
assert_model_valid_sheets
Checks model, which may hold open bodies — sheets, wires — is valid, failing with every validation error’s root message.
assert_valid
Checks part is a valid manifold model with consistent names, failing with the report of check_valid.
assert_valid_sheets
Checks part, which may hold open bodies — sheets, wires — is valid with consistent names, failing as assert_valid does.
assert_volume
Checks the solid named solid of part encloses expected, to within tolerance (see solid_volume).
check_valid
Whether part is a valid manifold model — if not, every validation error’s root message, one per line, and the names of the entities they mention.
classify
Where the point p lies relative to the solid solid of part: inside it, outside it, or on its boundary — inside, if inside any of its shells.
edge_at
The name of the edge of part whose middle could be at p.
edges_where
The names of the edges of part that keep accepts, sorted.
edges_with_middle_where
The names of the edges of part whose middle keep accepts, as plain numbers, sorted.
error
The error result holds, for a test that expects one.
face_towards
The planar face of solid whose outward normal is normal, lying furthest that way.
given_part
A part of one step that defines its model as model: what the tests of an operation, an exporter or an inspector build on.
has_vertex
Whether part has a vertex that could be at p.
middle
The middle of edge, halfway along its curve’s domain.
model_of
The model part holds: empty if it built no topology.
model_shown
The model the editor editor shows: what the program it edits builds, as far as it runs it.
outcome
Applies a step of O with args to a copy of part and says how it went: refused, where the error’s root message is one is_refusal accepts — the operation refusing what it does not support, rather than failing at what it does.
run_step
Runs O’s step step with args on part, after the steps it ran: the next step of a program built one step at a time, on a model given (see given_part).
runner_of
A runner of programs written in the operations registry makes, as the file part.geop — of a workspace of no other files.
solid_volume
The volume the solid named solid of part encloses, from its mesh as drawn (see volume).
unit_cube
A unit cube, every entity named by its kind and its position among those: v0 … v7, e0 … e11, f0 … f5, s0.
vertex_at
The name of the vertex of part that could be at p.
volume
The volume solid of part encloses, from its mesh as drawn at resolution (see rasterize): negative if its faces point in. Its triangles’ corners are f32, as STL stores them: a test’s measuring stick, not a kernel comparison.