@@ -398,7 +398,7 @@ def test_board_details(run_command):
398398 # Download samd core pinned to 1.8.6
399399 result = run_command ("core install arduino:samd@1.8.6" )
400400 assert result .ok
401- result = run_command ("board details arduino:samd:nano_33_iot --format json" )
401+ result = run_command ("board details -b arduino:samd:nano_33_iot --format json" )
402402 assert result .ok
403403 # Sort everything before compare
404404 result = json .loads (result .stdout )
@@ -413,3 +413,28 @@ def test_board_details(run_command):
413413 assert result ["platform" ] == gold_board_details ["platform" ]
414414 for usb_id in gold_board_details ["identification_pref" ]:
415415 assert usb_id in result ["identification_pref" ]
416+
417+
418+ # old `arduino-cli board details` did not need -b <fqbn> flag to work
419+ def test_board_details_old (run_command ):
420+ result = run_command ("core update-index" )
421+ assert result .ok
422+ # Download samd core pinned to 1.8.6
423+ result = run_command ("core install arduino:samd@1.8.6" )
424+ assert result .ok
425+ result = run_command ("board details arduino:samd:nano_33_iot" )
426+ assert not result .ok
427+ assert result .stdout == ""
428+ assert 'Error: unknown command "arduino:samd:nano_33_iot" for "arduino-cli board details"' in result .stderr
429+
430+
431+ def test_board_details_no_flags (run_command ):
432+ result = run_command ("core update-index" )
433+ assert result .ok
434+ # Download samd core pinned to 1.8.6
435+ result = run_command ("core install arduino:samd@1.8.6" )
436+ assert result .ok
437+ result = run_command ("board details" )
438+ assert not result .ok
439+ assert 'Error: required flag(s) "fqbn" not set in result.stderr'
440+ assert result .stdout == ""
0 commit comments