Expand description
Shared test utilities for the workspace.
Available unconditionally to keep the surface usable from binary crates, integration tests, and benches. Helpers fall in two buckets:
- Builders:
LeafBuilder,with_children— buildPlanvalues without repeating boilerplate..Default::default()blocks. - Assertions:
assert_contains_all,strip_ansi,node_count— encapsulate the multi-line patterns that#[test]files intests/keep re-implementing.
These are intended for testing only but are exposed publicly so the
rustcmdpev binary’s integration tests can reuse them via the workspace
dependency.
Structs§
- Leaf
Builder - Builder for a leaf
Planwith the most common fields populated.
Functions§
- assert_
contains_ all - Assert that
textcontains every needle inneedles. Reports the first missing needle with a snippet of the surrounding text so failures point at the exact missing token instead of a wall of text. - assert_
contains_ none - Assert that
textcontains none of the substrings inneedles. - collect_
nodes - Recursively collect every node in a plan tree (depth-first, parent-first).
- explain_
for - Build a single-plan
Explainwith optional execution/total cost. - node_
count - Recursively count nodes in a plan tree.
- strip_
ansi - Strip ANSI escape sequences from
inputfor resilient text assertions. - with_
children - Wrap
parentso it haschildrenattached.