mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
Improving gcmd Code Coverage
This commit is contained in:
@ -63,6 +63,21 @@ func Test_Command_NewFromObject_Help(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func Test_Command_NewFromObject_Run(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
var (
|
||||
ctx = gctx.New()
|
||||
cmd, err = gcmd.NewFromObject(&TestCmdObject{})
|
||||
)
|
||||
t.AssertNil(err)
|
||||
t.Assert(cmd.Name, "root")
|
||||
|
||||
os.Args = []string{"root", "test", "-n=john"}
|
||||
|
||||
cmd.Run(ctx)
|
||||
})
|
||||
}
|
||||
|
||||
func Test_Command_NewFromObject_RunWithValue(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user