Files
sx/examples/0717-modules-cli-parse.sx
agra 9784ff8705 F3.2: assert Diag for the zero-arg and too-many-flags raise sites
Example 0717 now asserts the (token, index) Diag for ALL SIX raise sites
in cli.sx, closing the two the reviewer found still unasserted:

  - zero-arg UnknownCommand: parse([], ...) -> index -1, token ""
    (the args.len == 0 sub-branch of cli.sx:237, distinct from the
    one-arg too-few form already covered at index 0 / token args[0]).
  - TooManyFlags (cli.sx:256): a command declaring 17 flag specs (> the
    inline 16 cap) is rejected, not truncated -> index -1, token command.

The three index==-1 cases (zero-arg, too-many, missing-req) seed their
Diag with a sentinel before parse, so each assertion proves parse WROTE
the -1/"" rather than merely matching the `.{}` default. Verified
non-vacuous: flipping any expected value makes that line FAIL.

Test-only: cli.sx logic and src/ are untouched.
2026-06-04 07:54:20 +03:00

12 KiB