Expand description
Utilities to assert the structure of a DiagnosticsHierarchy.
Pretty much the useful assert_data_tree
macro
plus some utilities for it.
Macros§
- assert_
data_ tree - Macro to simplify tree matching in tests. The first argument is the actual tree passed as a
DiagnosticsHierarchyGetter
(e.g. aDiagnosticsHierarchy
or anInspector
). The second argument is given totree_assertion!
which creates aTreeAssertion
to validate the tree. - assert_
json_ diff - Macro to check a hierarchy with a nice JSON diff.
The syntax of the
expected
value is the same as that ofhierarchy!
, and essentially the same asassert_data_tree!
, except that partial tree matching is not supported (i.e. the keywordcontains
). - hierarchy
- This macro simplifies creating diagnostics hierarchies, to remove the need of writing multiple nested hierarchies and manually writing all properties.
- tree_
assertion - Macro to simplify creating
TreeAssertion
s. Commonly used indirectly through the second parameter ofassert_data_tree!
. Seeassert_data_tree!
for more usage examples.
Structs§
- AnyBool
Property - A PropertyAssertion that passes for any Boolean.
- AnyBytes
Property - A PropertyAssertion that passes for any Bytes.
- AnyDouble
Property - A PropertyAssertion that passes for any Double.
- AnyInt
Property - A PropertyAssertion that passes for any Int.
- AnyNumeric
Property - A PropertyAssertion that passes for any Int, Uint, or Double.
- AnyProperty
- A PropertyAssertion that always passes
- AnyString
Property - A PropertyAssertion that passes for any String.
- AnyUint
Property - A PropertyAssertion that passes for any Uint.
- Diagnostics
Hierarchy - A hierarchy of nodes representing structured data, such as Inspect or structured log data.
- Diff
- A difference between expected and actual output.
- Histogram
Assertion - An assertion for a histogram property.
- NonZero
IntProperty - A PropertyAssertion that passes for non-zero, signed integers.
- NonZero
Uint Property - A PropertyAssertion that passes for non-zero, unsigned integers.
- Tree
Assertion - Struct for matching against a Data tree (DiagnosticsHierarchy).
Traits§
- Diagnostics
Hierarchy Getter - A type which can function as a “view” into a diagnostics hierarchy, optionally allocating a new instance to service a request.
- Json
Getter - Property
Assertion - Trait implemented by types that can act as properies for assertion.