Crate diagnostics_assertions

Source
Expand description

Utilities to assert the structure of a DiagnosticsHierarchy.

Pretty much the useful assert_data_tree macro plus some utilities for it.

Macros§

  • Macro to simplify tree matching in tests. The first argument is the actual tree passed as a DiagnosticsHierarchyGetter (e.g. a DiagnosticsHierarchy or an Inspector). The second argument is given to tree_assertion! which creates a TreeAssertion to validate the tree.
  • Macro to check a hierarchy with a nice JSON diff. The syntax of the expected value is the same as that of hierarchy!, and essentially the same as assert_data_tree!, except that partial tree matching is not supported (i.e. the keyword contains).
  • This macro simplifies creating diagnostics hierarchies, to remove the need of writing multiple nested hierarchies and manually writing all properties.
  • Macro to simplify creating TreeAssertions. Commonly used indirectly through the second parameter of assert_data_tree!. See assert_data_tree! for more usage examples.

Structs§

Traits§

Functions§