v1.8.0
New features:
- add new
JSONPointer
operator following RFC 6901; - when 2 types differ but have the same short name, use full pkg name in error report;
- add Cmp and Smuggle hooks feature;
- new
td.Tuple
type added and itstd.TupleFrom()
builder. Useful to quickly test functions returning several values as in:price := func(p float64) (float64, string, error) { if p < 0 { return 0, "", errors.New("negative price not supported") } return p * 1.2, "€", nil } td.Cmp(t, td.TupleFrom(price(10)), td.TupleFrom(float64(12), "€", nil), ) td.Cmp(t, td.TupleFrom(price(-10)), td.TupleFrom(float64(0), "", td.Not(nil)), )
- when calling
tdhttp.NewRequest()
(and all other request builder methods) headers can be flattened withtd.Flatten()
.
Fixes:
- missing lock when resolving anchors;
BeLax
flag (set byLax
andJSON
operators) was not taken into account for operatorsAny
,Bag
,Code
,Contains
,None
,NotAny
,Set
,SubBagOf
,SubSetOf
,SuperBagOf
andSuperSetOf
.
Enjoy!