@@ -428,3 +428,43 @@ func TestRemoveSingleArgument(t *testing.T) {
428
428
require .NoError (t , err )
429
429
requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[\" https://example.com/yet_another_package_example_index.json\" ]" )
430
430
}
431
+
432
+ func TestRemoveMultipleArguments (t * testing.T ) {
433
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
434
+ defer env .CleanUp ()
435
+
436
+ // Create a config file
437
+ _ , _ , err := cli .Run ("config" , "init" , "--dest-dir" , "." )
438
+ require .NoError (t , err )
439
+
440
+ // Adds URLs
441
+ urls := [2 ]string {
442
+ "https://example.com/package_example_index.json" ,
443
+ "https://example.com/yet_another_package_example_index.json" ,
444
+ }
445
+ _ , _ , err = cli .Run ("config" , "add" , "board_manager.additional_urls" , urls [0 ], urls [1 ])
446
+ require .NoError (t , err )
447
+
448
+ // Verifies default state
449
+ stdout , _ , err := cli .Run ("config" , "dump" , "--format" , "json" )
450
+ require .NoError (t , err )
451
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls | length" , "2" )
452
+ requirejson .Contains (t , stdout , `
453
+ {
454
+ "board_manager": {
455
+ "additional_urls": [
456
+ "https://example.com/package_example_index.json",
457
+ "https://example.com/yet_another_package_example_index.json"
458
+ ]
459
+ }
460
+ }` )
461
+
462
+ // Remove all URLs
463
+ _ , _ , err = cli .Run ("config" , "remove" , "board_manager.additional_urls" , urls [0 ], urls [1 ])
464
+ require .NoError (t , err )
465
+
466
+ // Verifies all URLs have been removed
467
+ stdout , _ , err = cli .Run ("config" , "dump" , "--format" , "json" )
468
+ require .NoError (t , err )
469
+ requirejson .Query (t , stdout , ".board_manager | .additional_urls" , "[]" )
470
+ }
0 commit comments