@@ -543,3 +543,37 @@ func TestRemoveOnUnsupportedKey(t *testing.T) {
543
543
require .NoError (t , err )
544
544
requirejson .Query (t , stdout , ".daemon | .port" , "\" 50051\" " )
545
545
}
546
+
547
+ func TestSetSliceWithSingleArgument (t * testing.T ) {
548
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
549
+ defer env .CleanUp ()
550
+
551
+ // Create a config file
552
+ _ , _ , err := cli .Run ("config" , "init" , "--dest-dir" , "." )
553
+ require .NoError (t , err )
554
+
555
+ // Verifies default state
556
+ stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" )
557
+ require .NoError (t , err )
558
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[]" )
559
+
560
+ // Set an URL in the list
561
+ url := "https://example.com/package_example_index.json"
562
+ _ , _ , err = cli .Run ("config" , "set" , "board_manager.additional_urls" , url )
563
+ require .NoError (t , err )
564
+
565
+ // Verifies value is changed
566
+ stdout , _ , err = cli .Run ("config" , "dump" , "--format" , "json" )
567
+ require .NoError (t , err )
568
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[\" https://example.com/package_example_index.json\" ]" )
569
+
570
+ // Set an URL in the list
571
+ url = "https://example.com/yet_another_package_example_index.json"
572
+ _ , _ , err = cli .Run ("config" , "set" , "board_manager.additional_urls" , url )
573
+ require .NoError (t , err )
574
+
575
+ // Verifies value is changed
576
+ stdout , _ , err = cli .Run ("config" , "dump" , "--format" , "json" )
577
+ require .NoError (t , err )
578
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[\" https://example.com/yet_another_package_example_index.json\" ]" )
579
+ }
0 commit comments