aboutsummaryrefslogtreecommitdiffhomepage
path: root/command/builder_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'command/builder_test.go')
-rw-r--r--command/builder_test.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/command/builder_test.go b/command/builder_test.go
index 7b9a1701..05e29358 100644
--- a/command/builder_test.go
+++ b/command/builder_test.go
@@ -18,8 +18,14 @@ func TestBuild(t *testing.T) {
t.Run("direct zero length", func(t *testing.T) {
wantPanic := "invalid subcommand"
- t.Run("zero length name", func(t *testing.T) { defer checkRecover(t, "Command", wantPanic); c.Command("", "usage", stubHandler) })
- t.Run("zero length usage", func(t *testing.T) { defer checkRecover(t, "Command", wantPanic); c.Command("name", "", stubHandler) })
+ t.Run("zero length name", func(t *testing.T) {
+ defer checkRecover(t, "Command", wantPanic)
+ c.Command("", "usage", stubHandler)
+ })
+ t.Run("zero length usage", func(t *testing.T) {
+ defer checkRecover(t, "Command", wantPanic)
+ c.Command("name", "", stubHandler)
+ })
})
t.Run("direct adopt unique names", func(t *testing.T) {
@@ -34,8 +40,14 @@ func TestBuild(t *testing.T) {
t.Run("zero length", func(t *testing.T) {
wantPanic := "invalid subcommand tree"
- t.Run("zero length name", func(t *testing.T) { defer checkRecover(t, "New", wantPanic); c.New("", "usage") })
- t.Run("zero length usage", func(t *testing.T) { defer checkRecover(t, "New", wantPanic); c.New("name", "") })
+ t.Run("zero length name", func(t *testing.T) {
+ defer checkRecover(t, "New", wantPanic)
+ c.New("", "usage")
+ })
+ t.Run("zero length usage", func(t *testing.T) {
+ defer checkRecover(t, "New", wantPanic)
+ c.New("name", "")
+ })
})
t.Run("direct adopt unique names", func(t *testing.T) {