Skip to content

Commit

Permalink
test: add allCmd test
Browse files Browse the repository at this point in the history
  • Loading branch information
shiron-dev committed Dec 19, 2024
1 parent 4cb3a6d commit 6e7bad1
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions cmd/gen/all_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package gen

import (
"testing"
)

func TestAllCmd(t *testing.T) {
t.Parallel()

configFilePath, tempDir := genTestDir(t)

type args struct {
args []string
}

tests := []struct {
name string
args args
}{
{
name: "2 args",
args: args{args: []string{configFilePath, tempDir}},
},
{
name: "1 arg",
args: args{args: []string{configFilePath}},
},
{
name: "0 args",
args: args{args: []string{}},
},
{
name: "reversed args",
args: args{args: []string{tempDir, configFilePath}},
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

allCmd.Run(allCmd, tt.args.args)
})
}
}

0 comments on commit 6e7bad1

Please sign in to comment.