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
//! 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.
//!
//! # Installation
//!
//! Reference in **Cargo.toml** in the usual way:
//!
//! ```toml
//! test_help-rs = { version = "0.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 [`ApproximateEqualityEvaluator`];
//! * [`multiplier`] — multiplier-based [`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
declare_and_publish!;
declare_and_publish!;
declare_and_publish!;
// ///////////////////////////// end of file //////////////////////////// //