Skip to content

refactor(runner): extract subshell output type and formatter#656

Merged
Chemaclass merged 1 commit intomainfrom
refactor/runner-extract-subshell-formatter
May 3, 2026
Merged

refactor(runner): extract subshell output type and formatter#656
Chemaclass merged 1 commit intomainfrom
refactor/runner-extract-subshell-formatter

Conversation

@Chemaclass
Copy link
Copy Markdown
Member

🤔 Background

Iter 3 of the run_test slim-down. The [type]line decode block was inline: parse the encoded type, replace [failed]/[skipped]/[incomplete] markers with newlines, then call print_line and reassign the local.

💡 Changes

  • Extract bashunit::runner::extract_subshell_type — pulls the [type] prefix
  • Extract bashunit::runner::format_subshell_output — strips markers and returns the cleaned line
  • Keep the bashunit::state::print_line side effect at the call site so command substitution does not capture user-facing output (regression caught locally during the parallel test run; fix preserved)
  • Bash 3.0+ compatible

Pull the `[type]line` decode block out of `bashunit::runner::run_test`
into two pure helpers (`extract_subshell_type`, `format_subshell_output`).
The `print_line` side effect stays at the call site so command
substitution does not capture the user-facing output.
@Chemaclass Chemaclass added the refactoring Refactoring or cleaning related label May 3, 2026
@Chemaclass Chemaclass self-assigned this May 3, 2026
@Chemaclass Chemaclass merged commit fafbe6b into main May 3, 2026
30 checks passed
@Chemaclass Chemaclass deleted the refactor/runner-extract-subshell-formatter branch May 3, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Refactoring or cleaning related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant