Module xpct::matchers

source ·
Expand description

The matchers provided by this crate.

This module provides the underlying matcher implementations for the matcher functions exported at the crate root. For example, this module provides EqualMatcher, which is used to implement equal.

If you’re just writing tests and not writing custom matchers or formatters, you don’t need anything in this module.

If you want to change the formatting of one of the provided matchers, you can re-use the matcher implementation in this module and pair it with your own custom formatter.

See Writing Custom Formatters to learn how to change the formatting of the provided matchers.

See Writing Custom Matchers to learn how to implement your own matchers like the ones in this module.

Modules

  • Matchers for working with booleans.
  • Matchers for working with collections.
  • Combinator matchers for composing other matchers.
  • Matchers for working with Default values.
  • diffdiff
    Matchers that generate diffs between values.
  • Matchers for comparing if two values are equal.
  • Matchers for making assertions about struct fields.
  • Matchers for working with files.
  • Matchers that map values in a matcher pipeline.
  • Matchers that invert other matchers.
  • Matchers for working with numeric values.
  • Matchers for working with Option values.
  • Matchers for making assertions about the ordering of values.
  • Matchers for making assertions using patterns.
  • Matchers for working with Result values.
  • Matchers for working with strings.
  • Matchers for working with time.

Structs

  • A value that is returned by matchers when the actual value doesn’t meet some criteria.
  • A value that is returned by matchers when the expected and actual values differ.

Type Definitions

  • A value that is returned by matchers that compose other matchers by struct field.
  • A value that is returned by matchers that compose a list of other matchers.