-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae9634d
commit eb82eb2
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Comparisons: assert_approx_eq | ||
|
||
https://crates.io/crates/assert_approx_eq | ||
|
||
The `assert_approx_eq` crate provides the `assert_approx_eq` macro. The `assertables` crate has a deliberately-similar macro because we want to make it easy to migrate. | ||
|
||
Both crates have the same syntax for a comparison that uses the default delta: | ||
|
||
```rust | ||
assert_approx_eq!(a, b); // default delta is 1.0e-6 | ||
``` | ||
|
||
The `assert_approx_eq` crate uses an optional delta such as: | ||
|
||
```rust | ||
assert_approx_eq!(a, b, 1); // delta is 1 | ||
``` | ||
|
||
The `assertables` crate uses an explicit macro name with a delta: | ||
|
||
```rust | ||
assert_in_delta!(a, b, 1); // delta is 1 | ||
``` | ||
|
||
We prefer the explicit macro name, rather than a form with an optional delta |