Skip to content

Commit 405e0e1

Browse files
Add TestLibListDoesNotIncludeEmptyLibraries to lib_test.go
1 parent 68532bd commit 405e0e1

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

0 commit comments

Comments
 (0)