diff options
Diffstat (limited to 'command')
| -rw-r--r-- | command/builder_test.go | 1 | ||||
| -rw-r--r-- | command/parse_test.go | 3 | ||||
| -rw-r--r-- | command/unreachable_test.go | 6 |
3 files changed, 10 insertions, 0 deletions
diff --git a/command/builder_test.go b/command/builder_test.go index 95231841..7b9a1701 100644 --- a/command/builder_test.go +++ b/command/builder_test.go @@ -7,6 +7,7 @@ import ( ) func TestBuild(t *testing.T) { + t.Parallel() c := command.New(nil, nil, "test", nil) stubHandler := func([]string) error { panic("unreachable") } diff --git a/command/parse_test.go b/command/parse_test.go index ce013f20..c2956c6f 100644 --- a/command/parse_test.go +++ b/command/parse_test.go @@ -14,6 +14,8 @@ import ( ) func TestParse(t *testing.T) { + t.Parallel() + testCases := []struct { name string buildTree func(wout, wlog io.Writer) command.Command @@ -251,6 +253,7 @@ Commands: } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { + t.Parallel() wout, wlog := new(bytes.Buffer), new(bytes.Buffer) c := tc.buildTree(wout, wlog) diff --git a/command/unreachable_test.go b/command/unreachable_test.go index 71408189..9e8c19c9 100644 --- a/command/unreachable_test.go +++ b/command/unreachable_test.go @@ -6,15 +6,19 @@ import ( ) func TestParseUnreachable(t *testing.T) { + t.Parallel() + // top level bypasses name matching and recursive calls to Parse // returns when encountering zero-length args t.Run("zero-length args", func(t *testing.T) { + t.Parallel() defer checkRecover(t, "Parse", "attempted to parse with zero length args") _ = newNode(panicWriter{}, nil, " ", " ").Parse(nil) }) // top level must not have siblings t.Run("toplevel siblings", func(t *testing.T) { + t.Parallel() defer checkRecover(t, "Parse", "invalid toplevel state") n := newNode(panicWriter{}, nil, " ", "") n.append(newNode(panicWriter{}, nil, " ", " ")) @@ -23,6 +27,7 @@ func TestParseUnreachable(t *testing.T) { // a node with descendents must not have a direct handler t.Run("sub handle conflict", func(t *testing.T) { + t.Parallel() defer checkRecover(t, "Parse", "invalid subcommand tree state") n := newNode(panicWriter{}, nil, " ", " ") n.adopt(newNode(panicWriter{}, nil, " ", " ")) @@ -32,6 +37,7 @@ func TestParseUnreachable(t *testing.T) { // this would only happen if a node was matched twice t.Run("parsed flag set", func(t *testing.T) { + t.Parallel() defer checkRecover(t, "Parse", "invalid set state") n := newNode(panicWriter{}, nil, " ", "") set := flag.NewFlagSet("parsed", flag.ContinueOnError) |
