Skip to content

v1.13.0

Compare
Choose a tag to compare
@maxatome maxatome released this 18 Mar 22:29
· 42 commits to master since this release

Features

  • New operators:
    • ErrorIs to check the data is an error and matches a wrapped error (uses errors.Is behind the scene),
    • First to find the first matching item of a slice or an array then compare its content,
    • Grep to reduce a slice or an array before comparing its content,
    • Last to find the last matching item of a slice or an array then compare its content,
    • Recv to read from a channel and test value;
  • rework of JSON parsing:
    • introduction of raw strings,
    • literal \n, \r & \t accepted in strings,
    • $^Operator(params...) is possible,
    • "$^Operator(params...)" is possible,
    • Operator (without parenthesis) is possible,
    • accepts json.RawMessage;
  • anchoring is now possible using td.A and td.Anchor, the generic versions of td.T.A and td.T.Anchor;
  • td.Flatten now accepts an optional function to filter and/or transform the items before flattening them;
  • *td.T gains Assert and Require methods, to be consistent with existing td.Assert and td.Require;
  • introduce td.S function, to produce strings without needing fmt, shorter to write and following the same calling convention as test names (in other words auto-detecting Printf like format);
  • new TestDeepInGotOK config to allow to test go-testdeep operators (is forbidden by default, but useful when go-testdeep is used outside golang tests) including td.T.TestDeepInGotOK method;
  • tdhttp package:

As usual: enjoy! :)

What's changed in details

Full Changelog: v1.12.0...v1.13.0