add test
This commit is contained in:
@@ -17,7 +17,6 @@ func RegOptions() {
|
||||
flag.StringVar(&opts.Config, "config", "", "config file path - default: `pwd/config.yml`")
|
||||
flag.StringVar(&opts.Config, "f", "", "config file path - default: `pwd/config.yml`")
|
||||
flag.BoolVar(&opts.Help, "help", false, "show help")
|
||||
flag.BoolVar(&opts.Once, "once", false, "run once")
|
||||
flag.Parse()
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package option
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRegOptions(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
}{
|
||||
// TODO: Add test cases.
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
RegOptions()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetOptions(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
want *Options
|
||||
}{
|
||||
// TODO: Add test cases.
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := GetOptions(); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("GetOptions() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user