You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write some unit tests for my kingpin.Application, to test things like help output. To do that, I build the application the same as I would in my real program, and redirect output to a buffer. I also apparently have to tell the app not to terminate the program (the test) whenever it encounters an error. But when I do all of these things, I notice that the Terminate callback is called multiple times (though only when I have a subcommand) and the expected output is duplicated.
terminate(0)
Parse error: command not specified
usage: test [<flags>] <command> [<args> ...]
Test application.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
Commands:
help [<command>...]
Show help.
subcommand
A subcommand.
Actual output:
terminate(0)
terminate(0)
Parse error: command not specified
usage: test [<flags>] <command> [<args> ...]
Test application.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
Commands:
help [<command>...]
Show help.
subcommand
A subcommand.
usage: test [<flags>] <command> [<args> ...]
Test application.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
Commands:
help [<command>...]
Show help.
subcommand
A subcommand.
If there is a better way to do what I want to do, I'm all ears. But for now, this looks like a bug.
The text was updated successfully, but these errors were encountered:
I am trying to write some unit tests for my kingpin.Application, to test things like help output. To do that, I build the application the same as I would in my real program, and redirect output to a buffer. I also apparently have to tell the app not to terminate the program (the test) whenever it encounters an error. But when I do all of these things, I notice that the Terminate callback is called multiple times (though only when I have a subcommand) and the expected output is duplicated.
Here is a small reproducible test case.
Expected output:
Actual output:
If there is a better way to do what I want to do, I'm all ears. But for now, this looks like a bug.
The text was updated successfully, but these errors were encountered: