Skip to content

Move rendering out of state.sh into console_results.sh #868

Description

@Chemaclass

bashunit::state::print_line / print_tap_line do terminal and TAP output from the state module, which otherwise owns counters and the per-test payload. That is a layering inversion, and it was the sole reason the state.sh → parallel.sh call cycle existed before #862 broke it; 11 call sites still route rendering through the state module.

Correct home is console_results.sh.

Why it was not done in #862: bashunit::state::print_line is an override seam — tests/unit/custom_assertions_test.sh redefines it in three tests to capture output. Moving or renaming it changes a surface that user-written custom assertions may also rely on, so it needs its own PR with a compatibility decision, not a drive-by rename.

Related, from the same dependency-graph analysis:

  • runner.sh — fan-out 15, 56 functions, 75 KB; 19 distinct calls into state, 18 into env, 16 into helpers. The highest-value structural work in the tree.
  • console_results.sh — fan-in 14, 23 functions; a god-renderer, and snapshot-sensitive (80-column assumptions), so risky to split.
  • test_title.sh — a 100-byte pass-through to state::set_test_title that main.sh bypasses anyway.

Note that assert*.sh → console_results.sh across 10 modules is acyclic and deliberate, mandated by the fork-free hot path — that one should not be "fixed".

Metadata

Metadata

Assignees

Labels

refactoringRefactoring or cleaning related

Type

No type

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions