Skip to content

v1.9.0

Compare
Choose a tag to compare
@maxatome maxatome released this 09 Mar 22:21
· 192 commits to master since this release
a1d04bd

New features:

  • introducing new tdsuite helper, allowing to easily create testing suites, fully integrated with go-testdeep;
  • JSON, SubJSONOf and SuperJSONOf now accept almost all operators embedded directly in JSON thanks to our new custom JSON decoder:
    td.Cmp(t,
      got,
      td.JSON(`{"name": HasPrefix("Bob"), "age": Between(20, 25)}`),
    )
  • Re and ReAll capture parameter can now be a []interface{} (only []string until now);
  • Flatten is now able to flatten maps, can be useful when creating request using tdhttp package;
  • when a Cmp failure occurs outside the root of a test function, a trace of all successive function calls is displayed to help the user to understand/locate the error;
  • in tdhttp helper (aka the ultimate HTTP API tester), tdhttp.TestAPI gains several methods:
    • AutoDumpResponse allows to dump the HTTP response when the first error is encountered after a request,
    • OrDumpResponse dumps the response if at least one previous test failed,
    • Run runs a subtest,
    • T returns the internal instance of *td.T,
    • With creates a new *TestAPI instance.

Fixes:

  • reflect.Interface containing nil could produce wrong comparisons.

Enjoy!