Skip to content

1.0.0

Compare
Choose a tag to compare
@pellared pellared released this 05 Apr 21:30
· 37 commits to main since this release
v1.0.0
461846f

This release contains breaking changes.

The repository is moved to github.com/fluentassert/verify and the f package is renamed to verify.

The main additions are the new assertions for bool, constraints.Ordered, constraints.Float, constraints.Integer, string, error, []T, map[K]V, func() types.

Added

  • Add True, False, assertion functions.
  • Add Nil, NotNil, assertion functions.
  • Add NoError, IsError assertion functions.
  • Add Panics, NoPanic assertion functions.
  • Add Eventually, EventuallyChan assertion functions.
  • Add Ordered function which provides following assertions, in addition to Comparable, via FluentOrdered type:
    • Lesser
    • LesserOrEqual
    • GreaterOrEqual
    • Greater
  • Add String function which provides following assertions, in addition to Ordered, via FluentString type:
    • Empty
    • NotEmpty
    • Contain
    • NotContain
    • Prefix
    • NoPrefix
    • Sufix
    • NoSufix
    • EqualFold
    • NotEqualFold
    • MatchRegex
    • NotMatchRegex
  • Add Number function which provides following assertions, in addition to Ordered, via FluentNumber type:
    • InDelta
    • NotInDelta
    • InEpsilon
    • NotInEpsilon
  • Add Error function which provides following assertions, in addition to Any and String (for error message), via FluentObj and FluentString types:
    • Is
    • IsNot
    • As
    • NotAs
  • Add Slice function which provides following assertions, in addition to Any, via FluentSlice type:
    • Empty
    • NotEmpty
    • Equivalent
    • NotEquivalent
    • Contain
    • NotContain
    • Any
    • All
    • None
  • Add Map function which provides following assertions, in addition to Any, via FlientMap type:
    • Empty
    • NotEmpty
    • Contain
    • NotContain
    • ContainPair
    • NotContainPair
    • Any
    • All
    • None
  • Add FailureMessage.Prefix method together with And and Or functions to facilitate creating complex assertions.

Changed

  • The f package is renamed to verify.
  • Rename Obj and FluentObj to Any and FluentAny.
  • Rename Comparable and FluentComparable to Obj and FluentObj.
  • Change the Check assertion for any object so that the provided function has to return FailureMessage instead of a string.
  • Zero and NonZero methods are moved to FluentComparable.
  • Better failure messages.