@@ -29,16 +29,16 @@ import (
2929)
3030
3131type testArgsCase struct {
32- name string
33- args []string
32+ name string
33+ args []string
3434 successStr string
3535}
3636
3737func doParseCDKMainWithTimeout () {
3838
3939 result := make (chan bool , 1 )
4040
41- go func () {
41+ go func () {
4242 result <- cli .ParseCDKMain ()
4343 }()
4444
@@ -47,32 +47,31 @@ func doParseCDKMainWithTimeout() {
4747 log .Println ("check run ok, timeout in 2s, and return." )
4848 return
4949 case <- result :
50- return
50+ return
5151 }
5252
5353}
5454
5555func TestParseCDKMain (t * testing.T ) {
5656
57-
5857 // ./cdk eva 2>&1 | head
5958 // ./cdk run test-poc | head
6059 // ./cdk ifconfig | head
6160
6261 tests := []testArgsCase {
6362 {
64- name : "./cdk eva" ,
65- args : []string {"./cdk_cli_path" , "eva" },
63+ name : "./cdk eva" ,
64+ args : []string {"./cdk_cli_path" , "eva" },
6665 successStr : "current user" ,
6766 },
6867 {
69- name : "./cdk run test-poc" ,
70- args : []string {"./cdk_cli_path" , "run" , "test-poc" },
68+ name : "./cdk run test-poc" ,
69+ args : []string {"./cdk_cli_path" , "run" , "test-poc" },
7170 successStr : "run success" ,
7271 },
7372 {
74- name : "./cdk ifconfig" ,
75- args : []string {"./cdk_cli_path" , "ifconfig" },
73+ name : "./cdk ifconfig" ,
74+ args : []string {"./cdk_cli_path" , "ifconfig" },
7675 successStr : "GetLocalAddresses" ,
7776 },
7877 }
@@ -112,7 +111,6 @@ func TestParseCDKMain(t *testing.T) {
112111 t .Errorf (("parse cdk main failed, name: %s, args: %v, buf: %s" ), tt .name , tt .args , str )
113112 }
114113
115-
116114 })
117115
118116 // return to os.Stdout default
0 commit comments