From 5f2d04f665e9df66159097f0b27099b6c699748d Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 24 Sep 2018 11:27:50 +0200 Subject: [PATCH] Added test for 'core list' json output --- commands/commands_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/commands_test.go b/commands/commands_test.go index 977c7c9801c..003d3d74120 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -422,6 +422,11 @@ func TestCoreCommands(t *testing.T) { require.Contains(t, string(d), "arduino:avr") require.Contains(t, string(d), "1.6.16") + exitCode, d = executeWithArgs(t, "core", "list", "--format", "json") + require.Zero(t, exitCode, "exit code") + require.Contains(t, string(d), "arduino:avr") + require.Contains(t, string(d), "1.6.16") + // Replace avr with 1.6.17 exitCode, d = executeWithArgs(t, "core", "install", "arduino:avr@1.6.17") require.Zero(t, exitCode, "exit code") @@ -438,6 +443,10 @@ func TestCoreCommands(t *testing.T) { require.Zero(t, exitCode, "exit code") require.Contains(t, string(d), "arduino:avr") + exitCode, d = executeWithArgs(t, "core", "list", "--updatable", "--format", "json") + require.Zero(t, exitCode, "exit code") + require.Contains(t, string(d), "arduino:avr") + // Upgrade platform exitCode, d = executeWithArgs(t, "core", "upgrade", "arduino:avr@1.6.18") require.NotZero(t, exitCode, "exit code")