Skip to content

Releases: houseabsolute/detest

v0.0.6

27 Mar 15:38
Compare
Choose a tag to compare
  • Added a d.IsNot assertion.
  • Clarified that d.ValueIs only accepts literal values as its second argument, not a Comparer.

v0.0.5

27 Mar 14:53
Compare
Choose a tag to compare
  • 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 to d.Func.

v0.0.4

27 Mar 03:37
Compare
Choose a tag to compare
  • Even more nil fixes. The fix in the last release for passing nil to a FuncComparer wasn't quite right. I think I got it this time.

v0.0.3

27 Mar 03:37
Compare
Choose a tag to compare
  • Fixed a number of bugs with the handling of nil values. If you called d.Is(nil, d.Map(...)) you'd get a panic instead of a failure. The same applied to d.Slice, d.Struct, and the FuncComparer returned by d.Func and d.NamedFunc. If you called d.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 write var s *string or var s []int).
  • Calling d.Passes recorded the call's path as d.Is instead of d.Passes.
  • Fixed various bugs in struct testing that could lead to panics instead of test failures.

v0.0.2

26 Mar 20:48
Compare
Choose a tag to compare
  • Added a d.Passes method. This works just like d.Is except that the second argument must be a detest.Comparer. This reads better when using a detest.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 the d.Is test fails, then t.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 and d.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 to fmt.Sprintf to create the test name.

v0.0.1

26 Mar 15:46
Compare
Choose a tag to compare

This is the first release of detest. It's still very much a work in progress.