All notable changes to this project will be documented in this file.
The format is based on Common Changelog, and this project adheres to Semantic Versioning.
we now have field-by-field recursive comparison
-
add a field-by-field recursive comparison feature (PR #79)
-
add the ability to map a subject to its debug- or display-string representation (PR #77)
- Breaking: rename assertions
has_debug_messagetohas_debug_string(PR #75) - Breaking: rename assertions
has_display_messagetohas_display_string(PR #76)
- doc: provide an example on how to write a custom assertion method with reusing existing assertions
- doc: custom assertion in example
AssertOver18is implemented for genericS: Borrow<Person>
Custom assertion methods without expectations
- write custom assertion methods without the need to implement a custom expectation as well (PR #74)
Asserting some elements in a collection or an iterator
- verify that at least one element of an iterator or collection satisfies assertions (PR #73)
- assert some elements of an iterator against a predicate (PR #71)
- Breaking: rename method
each_item()toeach_element()(PR #72)
Pick elements of collections or iterators for assertion
- add new filter assertions for collections and iterators to pick specific elements for assertion (PR #70)
- add a new assertion that assures that the type and value are as expected (PR #66)
- do not print "assertion failed" with every assertion failure (PR #65)
- add an example of a helper function for asserting fields of a custom struct reusing existing assertions (PR #67)
"Does not contain" assertions for strings, collections and iterators and expectation combinators (not, all, any)
- assert types formatted for debug and display (PR #56)
- provide "does not..." assertions for strings (PR #53)
does_not_containassertion for collections and iterators (PR #57)does_not_contain_any_ofassertion for collection and iterators (PR #58)- Breaking: provide
Notexpectation combinator and revise failure messages (PR #52) - provide expectation combinators
AllandAny(PR #54) - Breaking: provide constructor functions for all expectations (including the combinators) (PR #55)
Asserting big and accurate numbers
- Number assertions for
num_bigint::BigIntandnum_bigint::BigUint(PR #46) - Number assertions for
bigdecimal::BigDecimalandbigdecimal::BigDecimalRef(PR #48) - Number assertions for
rust_decimal::Decimal(PR #47) - Decimal number specific assertions
has_scale_of,has_precision_ofandis_integer(PR #49) - Assertions for properties and classification of characters (
char) (PR #45)
- Assertions for
Resultare not available for borrowed&Result(PR #43) - Assertions for
Optionare not available for borrowed&Option(PR #42)
- Use a fake environment for testing functionality that depends on environment variables (PR #50)
Assertions for Error types
- Provide assertions for types that implement
std::error::Error(PR #38) - Add examples to the rustdoc of every assertion method (PR #39)
- Missing #[track_caller] annotations on some assertion methods (PR #40)
- Delete the trait
RangeLikeas it is unused (PR #41)
Assertions for map-like types (HashMap, BTreeMap) and assert items of collections/iterators
- Provide assertions for map-like types (PR #31)
- Assert each item in a collection or iterator (PR #35)
- Support dynamically composed expression in
Spec(PR #33) - Support dynamically composed description in
Spec(PR #34)
- Compile time error when assertions for closures are chained (PR #36)
- Remove implementation of
DefaultforDoesPanic(PR #37)
assert_that_codedoes not highlight diffs in failure (PR #30)
Soft assertions
- Support for soft assertions (PR #28)
- Respect
NO_COLORenvironment variablecoloredfeature (PR #23) - Provide
matchesregex assertion for strings (PR #24) - Accept any type of range in range assertions (PR #21)
- Doc: mark api elements gated behind a feature flag in rust doc (PR #22)
- Breaking: Rename crate feature
float_cmptofloat-cmp(PR #26)
The functionality of the crate feature remains the same.
Replace any occurrence of the crate featurefloat_cmpwithfloat-cmp. - Read diff format configuration only once per test run (PR #27)
assert_that_codedoes not highlight diffs in failure messages (PR #30)
More assertions provided
- Provide assertions for the length of
CStringandCStr(PR #13) - Provide assertions for the number of characters in strings (PR #14)
- Provide more assertions for the length of strings and collections (PR #15)
- Provide additional assertions for the order of values (PR #16)
- Provide additional assertions for integers and floats (PR #17)
- Breaking: Rename crate feature
floattofloat_cmp(PR #18)
The functionality of the crate feature remains the same.
Replace any occurrence of the crate featurefloatwithfloat_cmp.
Color-highlighted diffs in assertion failures
- Color highlighted differences between expected and actual values (PR #10)
- Move 'within margin of...' in failure message for is_close_to to separate line (PR #8)
- Set must_use attributes only to methods returning Self (PR #7)
- Remove (nearly) useless const for fn (PR #6)
- Assertion
has_error_messageasserting the string representation of an error type in aResult.
- Wrong assertions listed for the
Resulttype in README - Some broken links in the README
First release