8000 BCLI: give the min box cmd_* functions a writer core so tests drive the real output (T3 follow-up) · Issue #2993 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

BCLI: give the min box cmd_* functions a writer core so tests drive the real output (T3 follow-up) #2993

Open

Description

@mitodrummer

Follow-up from the pre-merge review of BCLI T3 (#2894, PR #2991).

cmd_box_list (crates/minimal/src/cmd/boxes/list.rs ~25), cmd_box_show (show.rs ~10) and cmd_box_rm (lifecycle.rs ~702, the Removed <box>. line) write to stdout().lock(), so tests can't drive them. T3's end-to-end test re-implements the list and show rendering in closures, missing show's UNKNOWN_SESSION_ID_LEAD branch, and nothing tests the Removed <box>. line.

Its box_command_ending helper also copies only part of failure_exit_code (main.rs ~226): BoxRunningRefusal gives 2, and everything else gives 1. It skips HeldNameRefusal (2), ProjectFileInvalid and ActivationRefused::exit_code (3).

Scope

  • Give each cmd_box_* a core that takes &mut impl Write for stdout and stderr, and point the first-slice end-to-end test at those cores.
  • Expose failure_exit_code's mapping so the test uses the real one.
  • Index the STATE column by header in the test (tests.rs ~6595), not with row.contains.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0