@@ -479,3 +479,43 @@ func TestRemoveSingleArgument(t *testing.T) {
479
479
require .NoError (t , err )
480
480
requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[\" https://example.com/yet_another_package_example_index.json\" ]" )
481
481
}
482
+
483
+ func TestRemoveMultipleArguments (t * testing.T ) {
484
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
485
+ defer env .CleanUp ()
486
+
487
+ // Create a config file
488
+ _ , _ , err := cli .Run ("config" , "init" , "--dest-dir" , "." )
489
+ require .NoError (t , err )
490
+
491
+ // Adds URLs
492
+ urls := [2 ]string {
493
+ "https://example.com/package_example_index.json" ,
494
+ "https://example.com/yet_another_package_example_index.json" ,
495
+ }
496
+ _ , _ , err = cli .Run ("config" , "add" , "board_manager.additional_urls" , urls [0 ], urls [1 ])
497
+ require .NoError (t , err )
498
+
499
+ // Verifies default state
500
+ stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" )
501
+ require .NoError (t , err )
502
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls | length" , "2" )
503
+ requirejson .Contains (t , stdout , `
504
+ {
505
+ "board_manager": {
506
+ "additional_urls": [
507
+ "https://example.com/package_example_index.json",
508
+ "https://example.com/yet_another_package_example_index.json"
509
+ ]
510
+ }
511
+ }` )
512
+
513
+ // Remove all URLs
514
+ _ , _ , err = cli .Run ("config" , "remove" , "board_manager.additional_urls" , urls [0 ], urls [1 ])
515
+ require .NoError (t , err )
516
+
517
+ // Verifies all URLs have been removed
518
+ stdout , _ , err = cli .Run ("config" , "dump" , "--format" , "json" )
519
+ require .NoError (t , err )
520
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[]" )
521
+ }
0 commit comments