- Tables are now limited to the width of the terminal. Longer rows will be wrapped.
- Added a
d.IsNot
assertion. - Clarified that
d.ValueIs
only accepts literal values as its second argument, not aComparer
.
- Fix handling of functions passed to
d.Func
which take an interface as an argument. No matter what was passed to them detest would treat it as an error because the types didn't match. - Make it possible to call additional detest assertion methods, like
d.Is
, inside a func passed tod.Func
.
- Even more
nil
fixes. The fix in the last release for passingnil
to aFuncComparer
wasn't quite right. I think I got it this time.
- Fixed a number of bugs with the handling of
nil
values. If you calledd.Is(nil, d.Map(...))
you'd get a panic instead of a failure. The same applied tod.Slice
,d.Struct
, and theFuncComparer
returned byd.Func
andd.NamedFunc
. If you calledd.Is(nil, ...)
it would sometimes consider the two argument not nil, if the second argument was a nil of a specific type (like you get if you writevar s *string
orvar s []int
). - Calling
d.Passes
recorded the call's path asd.Is
instead ofd.Passes
. - Fixed various bugs in struct testing that could lead to panics instead of test failures.
-
Added a
d.Passes
method. This works just liked.Is
except that the second argument must be adetest.Comparer
. This reads better when using adetest.FuncComparer
, since we're not testing exact equality in this case. -
Added a
d.Require
method. This is used something like this:d.Require(d.Is(got, 42, "answer is 42"))
If the
d.Is
test fails, thent.Fatal
will be called and the current goroutine is aborted. This lets you exit a set of tests early if a key assertion fails. -
Change
d.Is
andd.ValueIs
to take multiple final arguments. If only one argument is provided, this is used as the test name. If multiple are provided, then these are passed tofmt.Sprintf
to create the test name.
- First release upon an unsuspecting world.