Problem
bin/binary_sdk_bridge.dart is the primary user-facing surface — it does argument parsing, defensive numeric parsing with custom error messages, flavor validation, --dry-run output, --force/overwrite error handling, and the final "Next steps" message — but it is not covered by any test, and it is not part of the coverage report the repo already generates. All existing tests in test/generator_test.dart exercise BridgeSpec/BridgeGenerator directly, never the CLI's main().
Evidence
coverage/lcov.info lists SF: entries only for lib/src/generator.dart, lib/src/spec.dart, and the three lib/src/templates/*.dart files — there is no SF:.../bin/binary_sdk_bridge.dart entry anywhere in the file, confirming it is excluded from coverage entirely (grep -n "^SF:" coverage/lcov.info).
grep -rn for the CLI's own file across test/ returns nothing; test/generator_test.dart never imports or shells out to bin/binary_sdk_bridge.dart.
.github/workflows/ci.yml's "Generated output is valid" step (lines 27-49) does invoke the CLI (dart run bin/binary_sdk_bridge.dart ...), but only on the happy path with fully-valid arguments — it asserts nothing about the CLI's own behavior (exit codes, error text, --dry-run listing format).
- Concretely untested code paths in
bin/binary_sdk_bridge.dart:
_fail / exit code 64 on missing --name/--org (lines 55-60) or a non-numeric --min-sdk/--compile-sdk/--java (lines 62-77).
- The
--dry-run branch (lines 106-113), which lists planned files without writing them.
- The
StateError → exitCode = 1 path when --force is omitted and the output directory already exists (lines 115-122).
args.flag('help') || arguments.isEmpty printing usage (line 50-53).
Proposed fix
Add a test/cli_test.dart that invokes the CLI as a subprocess (Process.run('dart', ['run', 'bin/binary_sdk_bridge.dart', ...]), mirroring the pattern CI already uses) or, preferably, refactor main()'s body into a testable function (e.g. int run(List<String> arguments, {required Stdout out, required Stdout err})) that unit tests can call directly without spawning a process. Cover at minimum: missing required flags exits 64 with the usage text, an invalid --flavor/non-numeric flag exits 64, --dry-run lists files without touching disk, and re-running without --force on an existing directory exits 1.
Acceptance criteria
Problem
bin/binary_sdk_bridge.dartis the primary user-facing surface — it does argument parsing, defensive numeric parsing with custom error messages, flavor validation,--dry-runoutput,--force/overwrite error handling, and the final "Next steps" message — but it is not covered by any test, and it is not part of the coverage report the repo already generates. All existing tests intest/generator_test.dartexerciseBridgeSpec/BridgeGeneratordirectly, never the CLI'smain().Evidence
coverage/lcov.infolistsSF:entries only forlib/src/generator.dart,lib/src/spec.dart, and the threelib/src/templates/*.dartfiles — there is noSF:.../bin/binary_sdk_bridge.dartentry anywhere in the file, confirming it is excluded from coverage entirely (grep -n "^SF:" coverage/lcov.info).grep -rnfor the CLI's own file acrosstest/returns nothing;test/generator_test.dartnever imports or shells out tobin/binary_sdk_bridge.dart..github/workflows/ci.yml's "Generated output is valid" step (lines 27-49) does invoke the CLI (dart run bin/binary_sdk_bridge.dart ...), but only on the happy path with fully-valid arguments — it asserts nothing about the CLI's own behavior (exit codes, error text,--dry-runlisting format).bin/binary_sdk_bridge.dart:_fail/ exit code 64 on missing--name/--org(lines 55-60) or a non-numeric--min-sdk/--compile-sdk/--java(lines 62-77).--dry-runbranch (lines 106-113), which lists planned files without writing them.StateError→exitCode = 1path when--forceis omitted and the output directory already exists (lines 115-122).args.flag('help') || arguments.isEmptyprinting usage (line 50-53).Proposed fix
Add a
test/cli_test.dartthat invokes the CLI as a subprocess (Process.run('dart', ['run', 'bin/binary_sdk_bridge.dart', ...]), mirroring the pattern CI already uses) or, preferably, refactormain()'s body into a testable function (e.g.int run(List<String> arguments, {required Stdout out, required Stdout err})) that unit tests can call directly without spawning a process. Cover at minimum: missing required flags exits 64 with the usage text, an invalid--flavor/non-numeric flag exits 64,--dry-runlists files without touching disk, and re-running without--forceon an existing directory exits 1.Acceptance criteria
bin/binary_sdk_bridge.dart(or an extracted, equivalently-coveredrun()function) appears incoverage/lcov.infowith non-trivial line coverage.dart testin CI without requiring changes to.github/workflows/ci.yml's existing steps.