Open dnephin opened 6 years ago
Thank you for reaching out, I didn't know about the tooling from gotestyourself and they look really nice.
I haven't had time to go through each of the problems, but some general thoughts
t.Helper
is only available in later go versions, currently this package supports down to 1.4 so this is a longer discussion probably+1 to have @dnephin on board. we should somehow merge the projects.
Hello, I'm wondering if you are planning on fixing some of the problems with the package interface.
I think some of the main problems are:
Foo
andFoof
, and essentially duplicated again inrequire
(since the code is generated this is more of an issue for users and less for maintenance, also less code generation wouldn't hurt).HTTP
andJSON
assertions belong in a separate package for testing http requestsrequire
behaves the way most people would expectassert
to behave.assert
is more of a "check"Equal
usesreflect.DeepEqual()
which has many shortcomings, which can be fixed by using https://godoc.org/github.com/google/go-cmp/cmpI have been working on a library which I believe fixes all of these issues: https://github.com/gotestyourself/gotestyourself/pull/34
In addition to fixing these issues, some of the benefits to this design are:
t.Helper()
exists there's no need to calculate line numbers, so all that code is removedfunc() (bool, string)
) that return success/failure message. This also removes the need for code generation, and still supports both Fail and FailNowAssert()
supports booleans as well as Comparison, so trivial compares of booleans, orx != nil
can be done inline, and the source is printed as the failure message(ex: "assertion failed: x != nil is false")I'm writing a tool that translates
testify.Assert
intoassert.Assert()
usinggo/ast
rewriting, to make it trivial to migrate a project to the new interface.Since you are spending time on this fork, and looking for maintainers I'm wondering if our goals are aligned and we might be able to share some work.