Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport method type in "-only" regular expression option #35
Comments
|
This is actually already supported for both "-only" and "-excl", but it is a bit awkward to use. The command for your example would be gotests/internal/models/models.go Lines 121 to 127 in c51312f However the "FullName" uses title case for both receiver type and function name, and has no separator. Maybe it should be changed to match your example of structA.PrintName?
|
|
@avgeorge package main
type foobar struct{}
type fooBar struct{}
type Foobar struct{}
type FooBar struct{}
func (a foobar) Func() {}
func (a fooBar) Func() {}
func (a Foobar) Func() {}
func (a FooBar) Func() {}
func Func() {}
func main() {}
I don't know whether the output is in the plan or not. |
Currently with the option “-only” it is not possible to provide the “struct type” in the regular expression.
example:
if we run
gotests -only PrintNameit will generate the unit-tests for both functionsit could be interesting to support also the struct type in the regular expression like this:
gotests -only structA.PrintNameorgotests -only (structA).SetNameor create a new option: “-exact”:
gotests -exact (structA).PrintNameorgotests -exact structA.PrintName