Skip to content

test: add REPL dispatch function tests #162

@rocketman-code

Description

@rocketman-code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Critical priorityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions