Skip to content

Commit 216c0df

Browse files
committed
doc: mention field-by-field recursive comparison mode in README
1 parent b2829e9 commit 216c0df

1 file changed

Lines changed: 28 additions & 7 deletions

File tree

README.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ Features of `asserting`:
1212
1. assertions are convenient to write and easy to read
1313
2. helpful error messages in case of failing assertions
1414
3. colored diffs between expected and actual values
15-
4. provide a reasonable number of assertions out of the box
16-
5. chaining of multiple assertions on the same subject (see ["Chaining assertions"])
15+
4. chaining of multiple assertions on the same subject (see ["Chaining assertions"])
16+
5. field-by-field recursive comparison (see ["Field-by-field recursive comparison"]) :new:
1717
6. soft assertions (execute multiple assertions before panicking) (see ["Soft assertions"])
18-
7. do not require that asserted types have to implement traits if it is not absolutely necessary
19-
8. support for asserting custom types with provided assertions
20-
9. writing custom assertions requires minimal effort
21-
10. support no-std environments
18+
7. provide a reasonable number of assertions out of the box
19+
8. do not require that asserted types have to implement traits if it is not absolutely necessary
20+
9. support for asserting custom types with provided assertions
21+
10. writing custom assertions requires minimal effort
22+
11. support no-std environments
2223

2324
For an overview of the provided features and many examples on how to use `asserting` see the
2425
[crate-level documentation][docs-url].
@@ -83,11 +84,29 @@ require std can still be added.
8384

8485
```toml
8586
[dev-dependencies]
86-
asserting = { version = "0.13", default-features = false, features = ["colored", "float-cmp", "regex"] }
87+
asserting = { version = "0.13", default-features = false, features = ["colored", "float-cmp", "recursive", "regex"] }
8788
```
8889

8990
An allocator is still needed for no-std.
9091

92+
## Crate Features
93+
94+
Overview of the crate features of `asserting`. The column "no-std" specifies if this feature is
95+
available in no-std environments. The column "default" specifies if this feature is enabled by
96+
default.
97+
98+
| Feature | Description | no-std | default |
99+
|----------------|-------------------------------------------------------------------------------|:------:|:-------:|
100+
| `std` | Use the `std` library | no | yes |
101+
| `colored` | Colored highlighting of differences in failure reports in the terminal | yes | yes |
102+
| `recursive` | Field-by-field recursive comparison mode | yes | yes |
103+
| `float-cmp` | Floating point comparison (`ìs_close_to`) | yes | yes |
104+
| `regex` | String matches Regex assertions (`matching`) | yes | yes |
105+
| `panic` | Assert that code panics (with the expected message) | no | yes |
106+
| `num-bigint` | Enhanced support for `num-bigint::BigInt` | yes | no |
107+
| `bigdecimal` | Enhanced support for `bigdecimal::BigDecimal` and `bigdecimal::BigDecimalRef` | yes | no |
108+
| `rust-decimal` | Enhanded support for `rust_decimal::Decimal` | yes | no |
109+
91110
## Highlighted differences
92111

93112
`asserting` can highlight the differences between the expected value(s) and the actual value(s) when
@@ -493,6 +512,8 @@ To start assertions on code, use the `assert_that_code!()` macro.
493512

494513
["Chaining assertions"]: https://docs.rs/asserting/latest/asserting/#chaining-assertions-on-the-same-subject
495514

515+
["Field-by-field recursive comparison"]: https://docs.rs/asserting/latest/asserting/#field-by-field-recursive-comparison
516+
496517
["soft assertions"]: https://docs.rs/asserting/#soft-assertions
497518

498519
[custom assertions]: https://docs.rs/asserting/#custom-assertions

0 commit comments

Comments
 (0)