@@ -22,6 +22,7 @@ import (
2222 "github.com/arduino/arduino-cli/cli/instance"
2323 "github.com/arduino/arduino-cli/configuration"
2424 "github.com/arduino/arduino-cli/rpc/commands"
25+ rpc "github.com/arduino/arduino-cli/rpc/commands"
2526 "github.com/arduino/go-paths-helper"
2627 "github.com/stretchr/testify/assert"
2728 "github.com/stretchr/testify/require"
@@ -52,7 +53,11 @@ func TestPlatformSearch(t *testing.T) {
5253 require .Nil (t , err )
5354 require .NotNil (t , inst )
5455
55- res , err := PlatformSearch (inst .GetId (), "retrokit" , true )
56+ res , err := PlatformSearch (& rpc.PlatformSearchReq {
57+ Instance : inst ,
58+ SearchArgs : "retrokit" ,
59+ AllVersions : true ,
60+ })
5661 require .Nil (t , err )
5762 require .NotNil (t , res )
5863
@@ -78,7 +83,11 @@ func TestPlatformSearch(t *testing.T) {
7883 Boards : []* commands.Board {{Name : "RK002" }},
7984 })
8085
81- res , err = PlatformSearch (inst .GetId (), "retrokit" , false )
86+ res , err = PlatformSearch (& rpc.PlatformSearchReq {
87+ Instance : inst ,
88+ SearchArgs : "retrokit" ,
89+ AllVersions : false ,
90+ })
8291 require .Nil (t , err )
8392 require .NotNil (t , res )
8493 require .Len (t , res .SearchOutput , 1 )
@@ -94,7 +103,11 @@ func TestPlatformSearch(t *testing.T) {
94103 })
95104
96105 // 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+ })
98111 require .Nil (t , err )
99112 require .NotNil (t , res )
100113 require .Len (t , res .SearchOutput , 2 )
@@ -120,7 +133,11 @@ func TestPlatformSearch(t *testing.T) {
120133 })
121134
122135 // 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+ })
124141 require .Nil (t , err )
125142 require .NotNil (t , res )
126143 require .Len (t , res .SearchOutput , 2 )
@@ -146,7 +163,11 @@ func TestPlatformSearch(t *testing.T) {
146163 })
147164
148165 // 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+ })
150171 require .Nil (t , err )
151172 require .NotNil (t , res )
152173 require .Len (t , res .SearchOutput , 2 )
@@ -172,7 +193,11 @@ func TestPlatformSearch(t *testing.T) {
172193 })
173194
174195 // 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+ })
176201 require .Nil (t , err )
177202 require .NotNil (t , res )
178203 require .Len (t , res .SearchOutput , 1 )
0 commit comments