Skip to content

Commit 14b5c8e

Browse files
Add TestLibListDoesNotIncludeEmptyLibraries to lib_test.go
1 parent 245ee4e commit 14b5c8e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

+17
Original file line numberDiff line numberDiff line change
@@ -1533,3 +1533,20 @@ func TestLibQueryParameters(t *testing.T) {
15331533
require.Contains(t, string(stdout),
15341534
"Starting download \x1b[36murl\x1b[0m=\"https://downloads.arduino.cc/libraries/github.com/firmata/Firmata-2.5.9.zip?query=upgrade-builtin\"\n")
15351535
}
1536+
1537+
func TestLibListDoesNotIncludeEmptyLibraries(t *testing.T) {
1538+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
1539+
defer env.CleanUp()
1540+
1541+
_, _, err := cli.Run("lib", "update-index")
1542+
require.NoError(t, err)
1543+
1544+
// Create a library that does not have neither a library.properties nor a ".h" fil
1545+
emptyLib := cli.SketchbookDir().Join("libraries", "empty")
1546+
require.NoError(t, emptyLib.MkdirAll())
1547+
1548+
// Check the output of lib list is empty
1549+
stdout, _, err := cli.Run("lib", "list", "--format", "json")
1550+
require.NoError(t, err)
1551+
requirejson.Empty(t, stdout)
1552+
}

0 commit comments

Comments
 (0)