Skip to content

Commit

Permalink
Add tests for the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoPologruto committed Dec 16, 2022
1 parent 09c0a93 commit 2729379
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions commands/core/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -73,6 +74,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

res, stat = PlatformSearch(&rpc.PlatformSearchRequest{
Expand All @@ -93,6 +95,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search the Package Maintainer
Expand All @@ -114,6 +117,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -125,6 +129,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search using the Package name
Expand All @@ -146,6 +151,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -157,6 +163,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search using the Platform name
Expand All @@ -178,6 +185,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -189,6 +197,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "info@retrokits.com",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search using a board name
Expand Down Expand Up @@ -237,6 +246,7 @@ func TestPlatformSearch(t *testing.T) {
{Name: "Arduino Industrial 101"},
{Name: "Linino One"},
},
Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"},
})

res, stat = PlatformSearch(&rpc.PlatformSearchRequest{
Expand Down Expand Up @@ -284,6 +294,7 @@ func TestPlatformSearch(t *testing.T) {
{Name: "Arduino Industrial 101"},
{Name: "Linino One"},
},
Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"},
})
}

Expand Down

0 comments on commit 2729379

Please sign in to comment.