Context
Parent: #160
10 of 12 dispatch_*() functions in repl.rs have zero direct tests. The 77 existing REPL tests all cover Command::parse() and parse_flags() — they verify inputs are parsed correctly but never verify that dispatch functions consume those inputs correctly. Three v0.4.0 bugs lived here (#143, #144, #147).
Expected Behavior
Integration tests that construct a real Session, call dispatch functions with various flag combinations, and assert on the output.
Scope
- Add tests for
dispatch_trace(), dispatch_chain(), dispatch_cut(), dispatch_diff(), dispatch_packages(), dispatch_imports(), dispatch_importers(), dispatch_info(), dispatch_show()
- Each dispatch function tested with at minimum:
- Default options (no flags)
--json flag (assert output is valid JSON)
--top N flag (assert output is truncated)
--include-dynamic flag (assert dynamic imports included)
- Invalid/missing target (assert error message)
- Use captured stdout (or return values) to assert output format
- Small fixture project for Session construction
Context
Parent: #160
10 of 12
dispatch_*()functions in repl.rs have zero direct tests. The 77 existing REPL tests all coverCommand::parse()andparse_flags()— they verify inputs are parsed correctly but never verify that dispatch functions consume those inputs correctly. Three v0.4.0 bugs lived here (#143, #144, #147).Expected Behavior
Integration tests that construct a real
Session, call dispatch functions with various flag combinations, and assert on the output.Scope
dispatch_trace(),dispatch_chain(),dispatch_cut(),dispatch_diff(),dispatch_packages(),dispatch_imports(),dispatch_importers(),dispatch_info(),dispatch_show()--jsonflag (assert output is valid JSON)--top Nflag (assert output is truncated)--include-dynamicflag (assert dynamic imports included)