gitee.com/h79/goutils@v1.22.10/common/system/cmd_test.go (about) 1 package system 2 3 import "testing" 4 5 func TestStripArgs(t *testing.T) { 6 7 args := []string{"c.exe", "-serviceName", "dim", "-serviceInstall", "true"} 8 args = StripArgs(args, "-serviceInstall") 9 10 t.Log(args) 11 } 12 13 func TestCommand(t *testing.T) { 14 res := SyncExec("cp cmd_test.go xxx.txt", 2) 15 t.Logf("result: %v", res) 16 }