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.
51 lines
954 B
Plaintext
51 lines
954 B
Plaintext
dispatch-group: ok
|
|
dispatch-command: ok
|
|
dispatch-index: ok
|
|
flag-value: ok
|
|
flag-value-set: ok
|
|
bool-set: ok
|
|
json-set: ok
|
|
no-rest: ok
|
|
value-is-view: ok
|
|
group-is-view: ok
|
|
dispatch-2nd: ok
|
|
2nd-bool: ok
|
|
2nd-json-unset: ok
|
|
sep-value: ok
|
|
sep-rest-len: ok
|
|
sep-rest-0: ok
|
|
sep-rest-1: ok
|
|
sep-no-bool: ok
|
|
bare-rest-len: ok
|
|
bare-rest-0: ok
|
|
dash-value: ok
|
|
err-zero-args: ok
|
|
err-unknown-cmd: ok
|
|
err-unknown-group: ok
|
|
err-too-few: ok
|
|
err-unknown-flag: ok
|
|
err-missing-value: ok
|
|
err-value-eats-flag: ok
|
|
err-missing-req: ok
|
|
err-too-many-flags: ok
|
|
diag-flag-tag: ok
|
|
diag-flag-token: ok
|
|
diag-cmd-tag: ok
|
|
diag-cmd-token: ok
|
|
diag-group-tag: ok
|
|
diag-group-token: ok
|
|
diag-too-few-tag: ok
|
|
diag-too-few-token: ok
|
|
diag-zero-args-tag: ok
|
|
diag-zero-args-token: ok
|
|
diag-missing-value-tag: ok
|
|
diag-missing-value-token: ok
|
|
diag-value-eats-tag: ok
|
|
diag-value-eats-token: ok
|
|
diag-req-tag: ok
|
|
diag-req-token: ok
|
|
diag-req-index: ok
|
|
diag-too-many-tag: ok
|
|
diag-too-many-token: ok
|
|
=== DONE ===
|