1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//! Test helpers for Rust.
//!
//! **test_help-rs** provides assertion macros and evaluators for
//! approximate equality of floating-point scalars and vectors in unit
//! tests — filling gaps around `f32` and `f64` comparisons in Rust's stock
//! testing support.
//!
//! Scalar comparisons report exact, approximate, or unequal results. Vector
//! comparisons apply the same evaluator element-wise and also report
//! unequal lengths or the first unequal element.
//!
//! The stock tolerance helpers are [`margin`], [`multiplier`], and
//! [`zero_margin_or_multiplier`]. Custom
//! [`traits::ApproximateEqualityEvaluator`] implementations can provide
//! other comparison strategies.
//!
//! The optional `"nan-equality"` feature treats two `NaN` values as exactly
//! equal in stock comparisons. The `"nightly-constants"` feature enables
//! additional standard-library constant tests and requires a nightly
//! toolchain; it is intended for crate development rather than downstream
//! use.
//!
//! # Installation
//!
//! Reference in **Cargo.toml** in the usual way:
//!
//! ```toml
//! test_help-rs = { version = "0.2.1" }
//! ```
//!
//! # Components
//!
//! ## Macros
//!
//! * [`assert_scalar_eq_approx!`] — scalar approximate equality;
//! * [`assert_scalar_ne_approx!`] — scalar approximate inequality;
//! * [`assert_vector_eq_approx!`] — vector approximate equality;
//! * [`assert_vector_ne_approx!`] — vector approximate inequality;
//!
//! ## Functions
//!
//! * [`margin`] — margin-based
//! [`traits::ApproximateEqualityEvaluator`];
//! * [`multiplier`] — multiplier-based
//! [`traits::ApproximateEqualityEvaluator`];
//! * [`zero_margin_or_multiplier`] — combined stock evaluator used by the
//! two-argument assertion macros;
//! * [`evaluate_scalar_eq_approx`] — scalar comparison without asserting;
//! * [`evaluate_vector_eq_approx`] — vector comparison without asserting;
//!
//! ## Types
//!
//! * [`ComparisonResult`] — outcome of a scalar comparison;
//! * [`VectorComparisonResult`] — outcome of a vector comparison;
//! * [`traits::ApproximateEqualityEvaluator`] — custom comparison strategy;
//! * [`traits::TestableAsF64`] — types usable with the assertion macros
//! (via [`base_traits::ToF64`]);
//!
//! ## Constants
//!
//! * [`constants::DEFAULT_MARGIN`] and [`constants::DEFAULT_MULTIPLIER`]
//! — stock tolerance values for the two-argument macros;
//!
//! # Examples
//!
//! ```
//! use test_helpers::{assert_scalar_eq_approx, margin};
//!
//! assert_scalar_eq_approx!(3.0, 3.0001, margin(0.0001));
//! ```
//!
//! See the project [README](https://github.com/synesissoftware/test_help-rs)
//! for further information.
// lib.rs : test_help-rs
pub
use cratedeclare_and_publish;
declare_and_publish!;
declare_and_publish!;
declare_and_publish!;
pub use base_traits;
// ///////////////////////////// end of file //////////////////////////// //