Have a modular application. Have a bunch of tests that use a set of application modules; each test requires a different set. Some modules are configured through the command line, for example:
func init() { flag.StringVar(&this.customPath, "gamedir.custom", "", "Custom game resources directory") }
But I can not check this functionality. If I run
go test -test.v ./... -gamedir.custom=c:/resources
execution responses with
flag provided but not defined: -gamedir.custom
and does not pass the test.
How am I wrong when testing command line arguments?
source share