Skip to content

Commit 24b6b7e

Browse files
Modify test_lib.go to test the changes
1 parent 80001b7 commit 24b6b7e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Diff for: internal/integrationtest/lib/lib_test.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func TestListWithFqbn(t *testing.T) {
421421
require.NoError(t, err)
422422

423423
// Install core
424-
_, _, err = cli.Run("core", "install", "arduino:avr")
424+
_, _, err = cli.Run("core", "install", "arduino:avr@1.8.6")
425425
require.NoError(t, err)
426426

427427
// Look at the plain text output
@@ -435,7 +435,7 @@ func TestListWithFqbn(t *testing.T) {
435435
require.NoError(t, err)
436436
require.Empty(t, stderr)
437437
lines := strings.Split(strings.TrimSpace(string(stdout)), "\n")
438-
require.Len(t, lines, 2)
438+
require.Len(t, lines, 7)
439439

440440
// Verifies library is compatible
441441
lines[1] = strings.Join(strings.Fields(lines[1]), " ")
@@ -447,11 +447,14 @@ func TestListWithFqbn(t *testing.T) {
447447
stdout, stderr, err = cli.Run("lib", "list", "-b", "arduino:avr:uno", "--format", "json")
448448
require.NoError(t, err)
449449
require.Empty(t, stderr)
450-
requirejson.Len(t, stdout, 1)
450+
requirejson.Len(t, stdout, 6)
451451

452452
// Verifies library is compatible
453-
requirejson.Query(t, stdout, `.[0] | .library | .name`, `"ArduinoJson"`)
454-
requirejson.Query(t, stdout, `.[0] | .library | .compatible_with | ."arduino:avr:uno"`, `true`)
453+
requirejson.Query(t, stdout, `sort_by(.library | .name) | .[0] | .library | .name`, `"ArduinoJson"`)
454+
requirejson.Query(t, stdout, `sort_by(.library | .name) | .[0] | .library | .compatible_with | ."arduino:avr:uno"`, `true`)
455+
456+
// Verifies bundled libs are shown if -b flag is used
457+
requirejson.Parse(t, stdout).Query(`.[] | .library | select(.container_platform=="arduino:[email protected]")`).MustNotBeEmpty()
455458
}
456459

457460
func TestListProvidesIncludesFallback(t *testing.T) {

0 commit comments

Comments
 (0)