-
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
28b4d23
commit bd437f5
Showing
462 changed files
with
614 additions
and
606 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Assertables: Rust crate of assert macros for testing | ||
|
||
Assertables is a Rust crate that provides many assert macros | ||
to improve your compile-time tests and run-time reliability. | ||
Assertables is a Rust crate of assert macros to improve you compile-time testing and run-time reliability. | ||
|
||
* Crate: [https://crates.io/crates/assertables](https://crates.io/crates/assertables) | ||
* Docs: [https://docs.rs/assertables/](https://docs.rs/assertables/) | ||
* Repo: [https://github.com/sixarm/assertables-rust-crate/](https://github.com/sixarm/assertables-rust-crate/) | ||
* Contact: [[email protected]](mailto:[email protected]) | ||
* Tagging: #assert #assertion #rust #testing #macros #tdd #testdrivendevelopment | ||
|
||
## Introduction | ||
|
||
|
@@ -17,13 +17,17 @@ that can help you develop, test, and debug. | |
[assert_lt](https://docs.rs/assertables/9.4.0/assertables/assert_lt), | ||
[assert_gt](https://docs.rs/assertables/9.4.0/assertables/assert_gt), | ||
[…](https://docs.rs/assertables) | ||
* Test groups with | ||
[assert_all](https://docs.rs/assertables/9.4.0/assertables/assert_all), | ||
[assert_any](https://docs.rs/assertables/9.4.0/assertables/assert_any), | ||
[…](https://docs.rs/assertables) | ||
* Test results with | ||
[assert_ok](https://docs.rs/assertables/9.4.0/assertables/assert_ok), | ||
[assert_err](https://docs.rs/assertables/9.4.0/assertables/assert_err), | ||
[…](https://docs.rs/assertables) | ||
* Test groups with | ||
[assert_all](https://docs.rs/assertables/9.4.0/assertables/assert_all), | ||
[assert_any](https://docs.rs/assertables/9.4.0/assertables/assert_any), | ||
* Test options with | ||
[assert_some](https://docs.rs/assertables/9.4.0/assertables/assert_some), | ||
[assert_none](https://docs.rs/assertables/9.4.0/assertables/assert_none), | ||
[…](https://docs.rs/assertables) | ||
* Test matching with | ||
[assert_matches](https://docs.rs/assertables/9.4.0/assertables/assert_matches), | ||
|
@@ -51,12 +55,6 @@ Benefits: | |
* You can handle more corner cases without needing to write custom code. | ||
* You can troubleshoot faster because error messages show more detail. | ||
|
||
Features: | ||
|
||
* Easy to use: everything is well-documented with runnable examples. | ||
* Zero overhead: if you don't use a macro, then it's not compiled. | ||
* Multiple forms: for panic, debug, result return, success return. | ||
|
||
Learning: | ||
[FAQ](https://github.com/SixArm/assertables-rust-crate/tree/main/help/faq), | ||
[docs](https://docs.rs/assertables/), | ||
|
@@ -108,12 +106,12 @@ assert_any!(a.into_iter(), |i: i32| i > 2); | |
|
||
Values: | ||
|
||
* [`assert_eq!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_eq) ≈ a = b | ||
* [`assert_ne!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_ne) ≈ a ≠ b | ||
* [`assert_lt!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_lt) ≈ a < b | ||
* [`assert_le!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_le) ≈ a ≤ b | ||
* [`assert_gt!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_gt) ≈ a > b | ||
* [`assert_ge!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_ge) ≈ a ≥ b | ||
* [`assert_eq!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_eq) ≈ a = b ≈ equal to | ||
* [`assert_ne!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_ne) ≈ a ≠ b ≈ not equal to | ||
* [`assert_lt!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_lt) ≈ a < b ≈ less than | ||
* [`assert_le!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_le) ≈ a ≤ b ≈ less than or equal to | ||
* [`assert_gt!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_gt) ≈ a > b ≈ greater than | ||
* [`assert_ge!(a, b)`](https://docs.rs/assertables/9.4.0/assertables/assert_ge) ≈ a ≥ b ≈ greater than or equal to | ||
|
||
Approximations: | ||
|
||
|
@@ -143,19 +141,19 @@ Results: | |
|
||
* [`assert_ok!(a)`](https://docs.rs/assertables/9.4.0/assertables/assert_ok) ≈ a is Ok | ||
* [`assert_err!(a)`](https://docs.rs/assertables/9.4.0/assertables/assert_err) ≈ a is Err | ||
* [`assert_ok_eq_x!(a, x)`](https://docs.rs/assertables/9.4.0/assertables/assert_ok/assert_ok_eq_x) ≈ a is Ok unwrap = x | ||
* [`assert_ok_eq_x!(a, x)`](https://docs.rs/assertables/9.4.0/assertables/assert_ok/assert_ok_eq_x) ≈ a is Ok ⇒ unwrap = x | ||
|
||
Options: | ||
|
||
* [`assert_some!(a)`](https://docs.rs/assertables/9.4.0/assertables/assert_some) ≈ a is Some | ||
* [`assert_none!(a)`](https://docs.rs/assertables/9.4.0/assertables/assert_none) ≈ a is None | ||
* [`assert_some_eq_x!(a, x)`](https://docs.rs/assertables/9.4.0/assertables/assert_some/assert_some_eq_x) ≈ a is Some unwrap = x | ||
* [`assert_some_eq_x!(a, x)`](https://docs.rs/assertables/9.4.0/assertables/assert_some/assert_some_eq_x) ≈ a is Some ⇒ unwrap = x | ||
|
||
Polls: | ||
|
||
* [`assert_ready!(a)`](https://docs.rs/assertables/9.4.0/assertables/assert_ready) ≈ a is Ready | ||
* [`assert_pending!(a)`](https://docs.rs/assertables/9.4.0/assertables/assert_pending) ≈ a is Pending | ||
* [`assert_ready_eq_x!(a, x)`](https://docs.rs/assertables/9.4.0/assertables/assert_ready/assert_ready_eq_x) ≈ a is Ready unwrap = x | ||
* [`assert_ready_eq_x!(a, x)`](https://docs.rs/assertables/9.4.0/assertables/assert_ready/assert_ready_eq_x) ≈ a is Ready ⇒ unwrap = x | ||
|
||
Readers: | ||
|
||
|
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
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
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
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
Oops, something went wrong.