create the program
This commit is contained in:
42
cmd/cli/cli_test.go
Normal file
42
cmd/cli/cli_test.go
Normal file
@ -0,0 +1,42 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_getListOfFiles(t *testing.T) {
|
||||
type args struct {
|
||||
args []string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want []string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "test",
|
||||
args: args{
|
||||
args: []string{"./cli*"},
|
||||
},
|
||||
want: []string{
|
||||
"cli.go",
|
||||
"cli_test.go",
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := getListOfFiles(tt.args.args)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("getListOfFiles() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("getListOfFiles() got = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user