@@ -5,32 +5,49 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8- ## [ Unreleased] ( https://github.com/pellared/fluentassert/compare/v0.1 .0...HEAD )
8+ ## [ Unreleased] ( https://github.com/pellared/fluentassert/compare/v0.2 .0...HEAD )
99
10- Redesign of the API by using generics.
10+ ## [ 0.2.0] ( https://github.com/pellared/fluentassert/releases/tag/v0.2.0 ) - 2022-10-01
11+
12+ This release is a complete rewrite.
13+ It is not compatible with the previous release.
14+
15+ The new API is type-safe and easier to extend.
16+
17+ It is highly probable that future releases will have no (or minimal)
18+ breaking changes.
19+
20+ The next release is supposed to provide assertions for
21+ ` constraints.Ordered ` , ` string ` , ` error ` , ` []T ` , ` map[K]V ` , ` func() ` .
1122
1223### Added
1324
14- - Add ` f.ErrorAssert ` and ` f.ErrorRequire ` which
15- operates on ` error ` instead of ` any ` .
16- - Add ` f.OrderedAssert ` and ` f.OrderedRequire ` which
17- operates on ` constraints.Ordered ` instead of ` any ` .
18- - Add ` Returned ` error assertion that checks if ` got ` is non-nil.
19- - Add ` Gt ` ordered assertion that checks if ` got ` is greater than ` want ` .
25+ - Add ` FailureMessage ` which encapsulates the failure message
26+ and methods for error reporting.
27+ - Add ` Obj[T any](got T) ` function which provides following assertions:
28+ - ` Check(fn func(got T) string) `
29+ - ` Should(pred func(got T) bool) `
30+ - ` ShouldNot(pred func(got T) bool) `
31+ - ` DeepEqual(want T, opts ...cmp.Option) `
32+ - ` NotDeepEqual(want T, opts ...cmp.Option) `
33+ - ` Zero() `
34+ - ` NonZero() `
35+ - Add ` Comparable[T comparable](got T) ` function which provides following assertions
36+ in addition to ` Obj(got T) ` :
37+ - ` Equal(want T) `
38+ - ` NotEqual(want T) `
2039
2140### Changed
2241
2342- Require Go 1.18.
24- - Existing parameters are ` any ` instead of ` interface{} ` .
25- - ` Nil ` assertion can be used only with ` f.ErrorAssert ` .
2643
2744### Fixed
2845
29- - Fix error reporting line (usage of ` t.Helper() ` ).
46+ - Fix error reporting line (use ` t.Helper() ` when available ).
3047
3148### Removed
3249
33- - ` Err ` assertion .
50+ - All functions and types (API rewrite) .
3451
3552## [ 0.1.0] ( https://github.com/pellared/fluentassert/releases/tag/v0.1.0 ) - 2021-05-11
3653
0 commit comments