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

@ -1067,6 +1067,39 @@ sched_repl_resource_table_test = executable(
dependencies: [scheduler_test_deps, libedit_dep],
install: false)
# Contract test for the interactive simulation REPL's Help & Breakpoint
# Discoverability component (scheduler-sim-repl-verbosity spec, task 9.1,
# Requirements 7.1-7.4): `help`'s listing groups commands into four labeled
# sections in a fixed order, aligns every command's description to one
# consistent column position throughout, lists `info config` together with
# its `info` siblings in the state-inspection section, lists `set units`
# alongside `set speed`/`set output`/`set verify` in the snapshot-and-
# parameters section, and enumerates the complete BP_KIND_TABLE event-type
# set on the `break` line. Same white-box #include pattern as
# sched_repl_resource_table_test above (core.c, core_clock.c, core_events.c,
# core_session.c, decision.c, plugin.c, plugins/builtin_fcfs.c, recording.c,
# recording_session.c, sim.c, sim_loop.c, sim_record.c, sim_verify.c,
# snapshot.c/snapshot_wire.c/snapshot_load.c, repl.c, repl_fmt.c,
# repl_rollup.c, repl_break.c, repl_info.c, repl_params.c) even though this
# file's own tests call only repl_print_help() directly -- no
# xce_sched_sim_driver_t/replay fixture needed. Split into its own file
# rather than appended to test_repl_execution_control.c -- that file was
# already 949 lines (pre-existing, over this project's 800-line cap) before
# this task began; landing this task's own section/column/discoverability
# tests there would have pushed it well past the ~1000-line split trigger
# this exact file family already established (the same reasoning that split
# test_repl_round_rollup.c/test_repl_event_echo.c/test_repl_resource_table.c
# out of their own siblings). `break`'s own unrecognized-event-type error
# message test (Requirement 7.5) lives in
# test_repl_breakpoints_inspection.c instead, per design.md's own file-
# placement guidance for this component.
sched_repl_help_test = executable(
'sched_repl_help_test',
['test_repl_help.c'],
include_directories:[incdir],
dependencies: [scheduler_test_deps, libedit_dep],
install: false)
# Contract test for the interactive simulation REPL's snapshot-capture and
# simulation-parameter command slice (scheduler-core spec, task 12.3, Req 5
# AC 22 "Snapshots"/"Simulation parameters"): `snapshot [FILE]` writes a
@ -1542,6 +1575,9 @@ test('scheduler repl breakpoints inspection test',
test('scheduler repl resource table test',
sched_repl_resource_table_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler repl help test',
sched_repl_help_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler repl snapshot params test',
sched_repl_snapshot_params_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])