@@ -492,3 +492,37 @@ func TestRemoveOnUnsupportedKey(t *testing.T) {
492
492
require .NoError (t , err )
493
493
requirejson .Query (t , stdout , ".daemon | .port" , "\" 50051\" " )
494
494
}
495
+
496
+ func TestSetSliceWithSingleArgument (t * testing.T ) {
497
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
498
+ defer env .CleanUp ()
499
+
500
+ // Create a config file
501
+ _ , _ , err := cli .Run ("config" , "init" , "--dest-dir" , "." )
502
+ require .NoError (t , err )
503
+
504
+ // Verifies default state
505
+ stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" )
506
+ require .NoError (t , err )
507
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[]" )
508
+
509
+ // Set an URL in the list
510
+ url := "https://example.com/package_example_index.json"
511
+ _ , _ , err = cli .Run ("config" , "set" , "board_manager.additional_urls" , url )
512
+ require .NoError (t , err )
513
+
514
+ // Verifies value is changed
515
+ stdout , _ , err = cli .Run ("config" , "dump" , "--format" , "json" )
516
+ require .NoError (t , err )
517
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[\" https://example.com/package_example_index.json\" ]" )
518
+
519
+ // Set an URL in the list
520
+ url = "https://example.com/yet_another_package_example_index.json"
521
+ _ , _ , err = cli .Run ("config" , "set" , "board_manager.additional_urls" , url )
522
+ require .NoError (t , err )
523
+
524
+ // Verifies value is changed
525
+ stdout , _ , err = cli .Run ("config" , "dump" , "--format" , "json" )
526
+ require .NoError (t , err )
527
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[\" https://example.com/yet_another_package_example_index.json\" ]" )
528
+ }
0 commit comments