Changelog History
Page 1
-
v1.7.0 Changes
July 19, 2020๐ New features:
๐ new (*td.T).RunAssertRequire function. Useful to avoid boilerplate code:
t.RunAssertRequire("GetAge", func (assert *td.T, require *td.T) { age, err := GetAge("Bob") require.CmpNoError(err) assert.Cmp(age, 42) })
๐ new tdhttp.TestAPI method Or(), useful to debug a test failure:
ta.Get("/person/42", "Accept", "application/json"). CmpJSONBody(td.JSON(
{"id": $1, "name": "Bob"}
, td.NotZero())). Or(func (body string) { t.Logf("received unexpected body: <%s>", body) })
๐ see the Or() documentation as the passed function can have a much more complex signature. It is inspired by Test::Mojo or() method and allows to easily inspect the response of the requested API when the checks fail.
๐ Fixes:
- โ #101 โ some data recursion cases were not correctly handled (reported and tested by @stewi1014);
- some panics due to the user misbehavior were not properly red-colored;
- โ
(*td.T).Run:
t.Config
is now copied instead of shared before using it in sub-func; - โ๏ธ typos in doc.
Enjoy!
-
v1.6.0 Changes
May 31, 2020๐ Changes:
- โ
td.TestingFT
interface is deprecated (but still usable) and superseded bytesting.TB
standard one: it allows to work with*testing.B
instances as well (or any other type implementingtesting.TB
); โ
(*td.T).RunT()
is deprecated (but still usable) and superseded by(*td.T).Run()
which now delegates totd.T.TB
if it implements aRun()
method with the following signature:(X) Run(string, func(X)) bool
๐ฅ Breaking changes:
- โ
as
td.TestingFT
interface is now an alias ontesting.TB
, it does not containRun(string,ย funcย (*testing.T)) bool
anymore; it is quite unlikely that
(*td.T).Run(string, func (*testing.T))
method is used, but if it is, all calls have to be replaced by(*td.T).Run(string,ย funcย (*td.T))
like in:tt.Run("my_test", func (tt *td.T) { t := tt.TB.(testing.T) ...})
โ note that even though
(*td.T).RunT()
is deprecated, it still works as expected. - โ
-
v1.5.0 Changes
May 17, 2020๐ New features:
- ๐ new
Flatten
function: useful to flatten noninterface{}
slices inSet
,Bag
arguments (but not only, read the doc); - โ panic messages due to user misuse of go-testdeep functions/methods are now red colored to help her/him to focus on her/his mistake and not think go-testdeep failed shamefully;
- ๐ delay colors initialization to the first use. So colors can now be disabled in golang playgroung. See the corresponding FAQ point;
- โก๏ธ optimize some type retrievals.
๐ Fix:
- forbid
Isa(nil)
because it is a nonsense and so avoid a deep panic.
๐ New FAQ entries:
- โ Why nil is handled so specifically?
- โ play.golang.org does not handle colors, error output is nasty
Enjoy and do not forget to star!
- ๐ new
-
v1.4.0 Changes
April 11, 2020๐ New features:
- ๐ฆ
tdhttp
package (aka HTTP API tester) enhanced and fully documented; - ๐ new
Delay
operator; - โ
Contains
operator reworked, smarter and[]byte
specifically handled; - โ
String
,HasPrefix
andHasSuffix
operators now operate on[]byte
too.
๐ Fixes:
- anchor feature on 32 bits platforms;
- โ๏ธ missing comments + typos.
Enjoy, but at home! ;)
- ๐ฆ
-
v1.3.0 Changes
February 29, 2020๐ฆ Package
github.com/maxatome/go-testdeep
is deprecated, it is recommended to usegithub.com/maxatome/go-testdeep/td
in new code.โ
github.com/maxatome/go-testdeep
is still usable so the compatibility is preserved.โ The only breaking change is the disappearance of
testdeep.DefaultContextConfig
. It should be replaced bytd.DefaultContextConfig
and so the go-testdeep import line should be changed (at least "github.com/maxatome/go-testdeep/td" should be added).โ To summarize: migration to
github.com/maxatome/go-testdeep/td
is not needed, only recommended, except iftestdeep.DefaultContextConfig
is used.To migrate:
import "github.com/maxatome/go-testdeep"โฆ testdeep.DefaultContextConfig = testdeep.ContextConfig{โฆ} testdeep.Cmp(โฆ)
๐ฆ or with "td" package alias:
import td "github.com/maxatome/go-testdeep" โฆ td.DefaultContextConfig = td.ContextConfig{โฆ} td.Cmp(โฆ)
๐ simply do (see import line changes):
import "github.com/maxatome/go-testdeep/td" โฆ td.DefaultContextConfig = td.ContextConfig{โฆ} td.Cmp(โฆ)
๐ See the FAQ point for details about this migration.
๐ And still, do not forget to visit https://go-testdeep.zetta.rocks/ and open an issue if something seems to be missing or not clear.
โ Happy testing!
-
v1.2.0 Changes
February 13, 2020๐ New features:
- ๐ new operator anchoring feature, see the corresponding FAQ section and the new anchoring methods;
- ๐ new
SStruct
operator (and its friendsCmpSStruct
&T.SStruct
),
โ Synopsis revisited (again)!
โ Enjoy powerful testing!
-
v1.1.2 Changes
November 18, 2019๐ New features:
- JSON expected by
JSON
,SubJSONOf
andSuperJSONOf
operators can now contain comments (/* โฆ */
or// โฆ
) and some simple operators can directly be embedded in JSON, as$^NotEmpty
for example; - ๐ New
SubJSONOf
&SuperJSONOf
operators; - โ
In case of error,
JSON
operator no longer truncates its JSON expected parameter in error message, but dumps all the operators involved using beautiful indented comments; - โ
Add
Assert() *T
,Require() *T
andAssertRequire() (*T, *T)
.
โ Enjoy powerful API testing!
- JSON expected by
-
v1.1.1 Changes
November 03, 2019๐ News:
- ๐ New web site go-testdeep.zetta.rocks;
- โ FAQ grew a little.
๐ New features:
- โ Add some tdhttp request builders shortcuts, see
tdhttp.Get
,tdhttp.Post
,tdhttp.PostJSON
,tdhttp.PostXML
, etc. - ๐ New
Catch
operator; - ๐ New
JSON
andTag
operators; - ๐ New BeLax feature with its
Lax
operator counterpart (+CmpLax
func) - โ
Ptr
etPPtr
operators gain someTypeBehind()
capabilities.
-
v1.1.0 Changes
July 07, 2019๐ New features:
- ๐ introducing
UseEqual
feature to allow an objet to handle its comparison. SeeT.UseEqual
andContextConfig.UseEqual
for details; - โ
tdhttp.NewRequest()
,tdhttp.NewJSONRequest()
andtdhttp.NewXMLRequest()
now accept headers definition; - โ Test name now colored in error reports;
- Missing/Extra summaries show the number of involved items/keys;
- Extra & missing maps items are now sorted;
- โ
Cmp
function/method now replacesCmpDeeply
(still available for backward compatibility); - โ Add new
Keys
andValues
operators; - โ
Code
&Smuggle
operators explicitly refuse variadic functions (and so avoid uncontrolled runtime panic).
๐ฅ Breaking changes:
- โ
*testdeep.T
now implementstestdeep.TestingFT
:- previous
Run()
method renamed toRunT()
, - un-shadow
Run(string, func(t*testing.T))
โ if you usedT.Run
just rename occurrences toT.RunT
, NewT()
handles*testdeep.T
as argument,
- previous
- โ
Do not export
testdeep.Base
andtestdeep.BaseOKNil
anymore. Should not be a problem. If it is, raise an issue.
๐ Bugs fixes:
- ๐ Fix a bug when compared slices have the same backend array.
Misc:
- ๐ Switch from gometalinter to GolangCI-Lint + enable more linters;
- ๐ pre-go1.12 t.Helper() bug workaround removed as corrected upstream;
- map iterations done with
reflect.MapIter
if goโฅ1.12; - logo changed a little :)
- ๐ introducing
-
v1.0.8 Changes
January 14, 2019- ANSI colored output
- โ
introducing helpers:
tdhttp
as first one (a.k.a. HTTP API testing helper)