Releases: houseabsolute/detest
Releases · houseabsolute/detest
v0.0.6
v0.0.5
- 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
.
v0.0.4
v0.0.3
- 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.
v0.0.2
- 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:
go d.Require(d.Is(got, 42, "answer is 42"))
If thed.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.