This commit is contained in:
Jay
2019-05-09 16:13:25 +08:00
parent e6f22deb49
commit 4fa99f16bd
11 changed files with 306 additions and 9 deletions
-1
View File
@@ -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()
}
+35
View File
@@ -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)
}
})
}
}