@@ -22,6 +22,7 @@ import (
22
22
"github.com/arduino/arduino-cli/cli/instance"
23
23
"github.com/arduino/arduino-cli/configuration"
24
24
"github.com/arduino/arduino-cli/rpc/commands"
25
+ rpc "github.com/arduino/arduino-cli/rpc/commands"
25
26
"github.com/arduino/go-paths-helper"
26
27
"github.com/stretchr/testify/assert"
27
28
"github.com/stretchr/testify/require"
@@ -52,7 +53,11 @@ func TestPlatformSearch(t *testing.T) {
52
53
require .Nil (t , err )
53
54
require .NotNil (t , inst )
54
55
55
- res , err := PlatformSearch (inst .GetId (), "retrokit" , true )
56
+ res , err := PlatformSearch (& rpc.PlatformSearchReq {
57
+ Instance : inst ,
58
+ SearchArgs : "retrokit" ,
59
+ AllVersions : true ,
60
+ })
56
61
require .Nil (t , err )
57
62
require .NotNil (t , res )
58
63
@@ -78,7 +83,11 @@ func TestPlatformSearch(t *testing.T) {
78
83
Boards : []* commands.Board {{Name : "RK002" }},
79
84
})
80
85
81
- res , err = PlatformSearch (inst .GetId (), "retrokit" , false )
86
+ res , err = PlatformSearch (& rpc.PlatformSearchReq {
87
+ Instance : inst ,
88
+ SearchArgs : "retrokit" ,
89
+ AllVersions : false ,
90
+ })
82
91
require .Nil (t , err )
83
92
require .NotNil (t , res )
84
93
require .Len (t , res .SearchOutput , 1 )
@@ -94,7 +103,11 @@ func TestPlatformSearch(t *testing.T) {
94
103
})
95
104
96
105
// Search the Package Maintainer
97
- res , err = PlatformSearch (inst .GetId (), "Retrokits (www.retrokits.com)" , true )
106
+ res , err = PlatformSearch (& rpc.PlatformSearchReq {
107
+ Instance : inst ,
108
+ SearchArgs : "Retrokits (www.retrokits.com)" ,
109
+ AllVersions : true ,
110
+ })
98
111
require .Nil (t , err )
99
112
require .NotNil (t , res )
100
113
require .Len (t , res .SearchOutput , 2 )
@@ -120,7 +133,11 @@ func TestPlatformSearch(t *testing.T) {
120
133
})
121
134
122
135
// Search using the Package name
123
- res , err = PlatformSearch (inst .GetId (), "Retrokits-RK002" , true )
136
+ res , err = PlatformSearch (& rpc.PlatformSearchReq {
137
+ Instance : inst ,
138
+ SearchArgs : "Retrokits-RK002" ,
139
+ AllVersions : true ,
140
+ })
124
141
require .Nil (t , err )
125
142
require .NotNil (t , res )
126
143
require .Len (t , res .SearchOutput , 2 )
@@ -146,7 +163,11 @@ func TestPlatformSearch(t *testing.T) {
146
163
})
147
164
148
165
// Search using the Platform name
149
- res , err = PlatformSearch (inst .GetId (), "rk002" , true )
166
+ res , err = PlatformSearch (& rpc.PlatformSearchReq {
167
+ Instance : inst ,
168
+ SearchArgs : "rk002" ,
169
+ AllVersions : true ,
170
+ })
150
171
require .Nil (t , err )
151
172
require .NotNil (t , res )
152
173
require .Len (t , res .SearchOutput , 2 )
@@ -172,7 +193,11 @@ func TestPlatformSearch(t *testing.T) {
172
193
})
173
194
174
195
// Search using a board name
175
- res , err = PlatformSearch (inst .GetId (), "Yún" , true )
196
+ res , err = PlatformSearch (& rpc.PlatformSearchReq {
197
+ Instance : inst ,
198
+ SearchArgs : "Yún" ,
199
+ AllVersions : true ,
200
+ })
176
201
require .Nil (t , err )
177
202
require .NotNil (t , res )
178
203
require .Len (t , res .SearchOutput , 1 )
0 commit comments