diff --git a/cmd/gen/gen_test.go b/cmd/gen/gen_test.go new file mode 100644 index 0000000..216fab7 --- /dev/null +++ b/cmd/gen/gen_test.go @@ -0,0 +1,31 @@ +package gen + +import ( + "testing" +) + +func TestGenCmd(t *testing.T) { + t.Parallel() + + type args struct { + args []string + } + + tests := []struct { + name string + args args + }{ + { + name: "ok", + args: args{args: []string{}}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + genCmd.Run(genCmd, tt.args.args) + }) + } +} diff --git a/cmd/gen/iterm_test.go b/cmd/gen/iterm_test.go index 0c492c2..2570765 100644 --- a/cmd/gen/iterm_test.go +++ b/cmd/gen/iterm_test.go @@ -8,5 +8,38 @@ func TestItermCmd(t *testing.T) { t.Parallel() configFilePath, tempDir := genTestDir(t) - itermCmd.Run(itermCmd, []string{configFilePath, tempDir}) + + 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() + + itermCmd.Run(itermCmd, tt.args.args) + }) + } } diff --git a/cmd/gen/vscode_test.go b/cmd/gen/vscode_test.go index f028db5..7bd8fc0 100644 --- a/cmd/gen/vscode_test.go +++ b/cmd/gen/vscode_test.go @@ -8,5 +8,38 @@ func TestVSCodeCmd(t *testing.T) { t.Parallel() configFilePath, tempDir := genTestDir(t) - vscodeCmd.Run(vscodeCmd, []string{configFilePath, tempDir}) + + 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() + + vscodeCmd.Run(vscodeCmd, tt.args.args) + }) + } }