Crate test_util

Source
Expand description

This crate defines a collection of useful utilities for testing rust code.

Macros§

assert_geq
Asserts that the first argument is greater than or equal to the second.
assert_gt
Asserts that the first argument is strictly greater than the second.
assert_leq
Asserts that the first argument is less than or equal to the second.
assert_lt
Asserts that the first argument is strictly less than the second.
assert_near
Asserts that x and y are within delta of one another.

Structs§

Counter
A mutually exclusive counter that is not shareable, but can be defined statically for the duration of a test. This simplifies the implementation of a simple test-global counter, avoiding the complexity of alternatives like std::sync::atomic objects that are typically wrapped in Arc()s, cloned, and require non-intuitive memory management options.