test(scheduler-sim-repl-verbosity): task 9.1 - RED tests for help/break discoverability

Adds failing tests for Requirement 7 (Discoverable Help and Breakpoint
Event Types): help's four labeled sections in correct order, one
consistent column width across every listed command, info config's
placement alongside its info siblings, set units's placement alongside
set speed/output/verify, the break line's complete BP_KIND_TABLE-derived
event-type listing, and break's own unrecognized-event-type error
listing the same complete set. Each new test hardcodes BP_KIND_TABLE's
current 12 tokens rather than referencing the not-yet-implemented
repl_bp_kind_names() accessor, so RED comes from genuine assertion
failures against today's behavior rather than a link error.

New tests for Requirements 7.1-7.4 land in a new test_repl_help.c
rather than test_repl_execution_control.c (949 lines going in, within
reach of this spec's own ~1000-line split trigger already flagged at
task 2.1) - proactive split per this spec's established practice,
documented in design.md. break's Requirement 7.5 error-message test
lands in test_repl_breakpoints_inspection.c exactly as originally
planned, alongside the pre-existing test_break_unrecognized_event_type_rejected
(left unmodified).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAWMhfRJFnmmnG8h97yUDd
This commit is contained in:
Rongsong Shen 2026-09-02 20:01:06 +00:00
parent 9db99964f0
commit bd77eea0a8
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
5 changed files with 657 additions and 1 deletions

View file

@ -131,6 +131,9 @@ flowchart TD
- `src/scheduler/testsuite/test_repl_resource_table.c` (new, per the Correction above) — `info worker`'s/`info resource`'s resource-listing table/grouping layout, `units_mode`-aware rendering, and `info worker`'s assigned-job-listing jobid-range-compression adoption (Requirements 6.4, 6.5, 6.6, 4.5).
- `src/scheduler/testsuite/test_repl_snapshot_params.c` — extended with `set units raw|human|both` parsing/validation tests (Requirement 6.2, 6.3), alongside its existing `set speed`/`set output`/`set verify` tests.
**Correction (post-review, task 9.1)**: `help`-listing structure tests (Requirement 7.1-7.4) do NOT land in `test_repl_execution_control.c` as this section originally directed (line 123 above). That file was already at 949 lines going into task 9.1 — within reach of the ~1000-line split trigger this same Correction note (task 2.1) told this task to watch for — and the new section/column/event-type-listing tests would have pushed it to ~1500 lines. They instead live in a new `src/scheduler/testsuite/test_repl_help.c` (555 lines), duplicating pre-existing fixture helpers (`capture_stdout_around`) per this file family's established convention, decided proactively before landing rather than after a review round — the same practice tasks 2.1, 3.1, and 8.1 already established. `test_repl_execution_control.c` remains untouched by task 9.1 and stays the designated home only for the Requirement 5 no-regression checks and the prompt-content tests (Requirement 5.5) it already carries. `break`'s own enriched unrecognized-event-type error test (Requirement 7.5) landed in `test_repl_breakpoints_inspection.c` exactly as line 128 above already specified — no correction needed there.
- `src/scheduler/testsuite/test_repl_help.c` (new, per the Correction above) — `help`'s four labeled sections in order, one consistent column width across all listed commands, `info config`'s placement in State Inspection, `set units`'s placement in Snapshot & Parameters, and the `break` line's complete `BP_KIND_TABLE`-derived event-type listing (Requirements 7.1, 7.2, 7.3, 7.4).
## System Flows
See the Architecture Pattern & Boundary Map diagram above — it is the only non-trivial flow this feature introduces (a per-round branching decision with two exit points: silent extension, or flush-and-restart). Per-event classification (Requirement 1) is a simple, non-branching gate and does not warrant a separate diagram. The three later-added components (REPL Prompt Context, Resource Value Formatter, Help & Breakpoint Discoverability) are likewise simple, single-purpose lookups/formatters with no multi-step state machine of their own — a name-list check, an adaptive-unit loop, and a table lookup, respectively — so none of them warrant a separate diagram either.

View file

@ -98,7 +98,7 @@
- _Boundary: Resource Value Formatter, Jobid Range Compressor_
- [ ] 9. (P) Discoverable `help` listing and `break` event types — Depends: 7.2
- [ ] 9.1 (P) Write failing tests for the reorganized `help` listing and `break`'s event-type discoverability
- [x] 9.1 (P) Write failing tests for the reorganized `help` listing and `break`'s event-type discoverability
- Cover: `help`'s output groups commands into the four labeled sections (execution control, breakpoints, state inspection, snapshot and parameters), uses one consistent column width throughout, lists `info config` alongside the other `info` subcommands, and lists `set units` alongside `set speed`/`set output`/`set verify` in the snapshot-and-parameters section; `help`'s `break` line and `break`'s unrecognized-event-type error both list the complete, current set of valid event types from the same source; no command's existence, argument parsing, or other output changes
- Observable: the new test cases fail against today's unordered, hand-padded `help` listing (with `info config` disconnected from its siblings) and `break`'s error message, which names no valid alternatives
- _Requirements: 7.1, 7.2, 7.3, 7.4, 7.5, 7.6_