99
1010func TestNewConanCommand (t * testing.T ) {
1111 cmd := NewConanCommand ()
12-
12+
1313 assert .NotNil (t , cmd )
1414 assert .Empty (t , cmd .commandName )
1515 assert .Nil (t , cmd .args )
@@ -19,19 +19,19 @@ func TestNewConanCommand(t *testing.T) {
1919
2020func TestConanCommand_SetCommandName (t * testing.T ) {
2121 cmd := NewConanCommand ()
22-
22+
2323 result := cmd .SetCommandName ("install" )
24-
24+
2525 assert .Equal (t , "install" , cmd .commandName )
2626 assert .Same (t , cmd , result , "SetCommandName should return same instance for chaining" )
2727}
2828
2929func TestConanCommand_SetArgs (t * testing.T ) {
3030 cmd := NewConanCommand ()
3131 args := []string {"." , "--build=missing" }
32-
32+
3333 result := cmd .SetArgs (args )
34-
34+
3535 assert .Equal (t , args , cmd .args )
3636 assert .Same (t , cmd , result , "SetArgs should return same instance for chaining" )
3737}
@@ -41,18 +41,18 @@ func TestConanCommand_SetServerDetails(t *testing.T) {
4141 serverDetails := & config.ServerDetails {
4242 ServerId : "test-server" ,
4343 }
44-
44+
4545 result := cmd .SetServerDetails (serverDetails )
46-
46+
4747 assert .Equal (t , serverDetails , cmd .serverDetails )
4848 assert .Same (t , cmd , result , "SetServerDetails should return same instance for chaining" )
4949}
5050
5151func TestConanCommand_CommandName (t * testing.T ) {
5252 cmd := NewConanCommand ()
53-
53+
5454 result := cmd .CommandName ()
55-
55+
5656 assert .Equal (t , "rt_conan" , result )
5757}
5858
@@ -62,9 +62,9 @@ func TestConanCommand_ServerDetails(t *testing.T) {
6262 ServerId : "test-server" ,
6363 }
6464 cmd .serverDetails = serverDetails
65-
65+
6666 result , err := cmd .ServerDetails ()
67-
67+
6868 assert .NoError (t , err )
6969 assert .Equal (t , serverDetails , result )
7070}
@@ -73,9 +73,9 @@ func TestConanCommand_GetCmd(t *testing.T) {
7373 cmd := NewConanCommand ()
7474 cmd .commandName = "install"
7575 cmd .args = []string {"." , "--build=missing" }
76-
76+
7777 execCmd := cmd .GetCmd ()
78-
78+
7979 assert .NotNil (t , execCmd )
8080 assert .Equal (t , "conan" , execCmd .Path [len (execCmd .Path )- 5 :]) // ends with "conan"
8181 assert .Contains (t , execCmd .Args , "install" )
@@ -85,43 +85,38 @@ func TestConanCommand_GetCmd(t *testing.T) {
8585
8686func TestConanCommand_GetEnv (t * testing.T ) {
8787 cmd := NewConanCommand ()
88-
88+
8989 env := cmd .GetEnv ()
90-
90+
9191 assert .NotNil (t , env )
9292 assert .Empty (t , env )
9393}
9494
9595func TestConanCommand_GetStdWriter (t * testing.T ) {
9696 cmd := NewConanCommand ()
97-
97+
9898 writer := cmd .GetStdWriter ()
99-
99+
100100 assert .Nil (t , writer )
101101}
102102
103103func TestConanCommand_GetErrWriter (t * testing.T ) {
104104 cmd := NewConanCommand ()
105-
105+
106106 writer := cmd .GetErrWriter ()
107-
107+
108108 assert .Nil (t , writer )
109109}
110110
111111func TestConanCommand_ChainedSetters (t * testing.T ) {
112112 serverDetails := & config.ServerDetails {ServerId : "test" }
113-
113+
114114 cmd := NewConanCommand ().
115115 SetCommandName ("upload" ).
116116 SetArgs ([]string {"pkg/1.0" , "-r" , "remote" }).
117117 SetServerDetails (serverDetails )
118-
118+
119119 assert .Equal (t , "upload" , cmd .commandName )
120120 assert .Equal (t , []string {"pkg/1.0" , "-r" , "remote" }, cmd .args )
121121 assert .Equal (t , serverDetails , cmd .serverDetails )
122122}
123-
124-
125-
126-
127-
0 commit comments