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".
bashunit::state::print_line/print_tap_linedo 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 thestate.sh → parallel.shcall 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_lineis an override seam —tests/unit/custom_assertions_test.shredefines 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 intostate, 18 intoenv, 16 intohelpers. 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 tostate::set_test_titlethatmain.shbypasses anyway.Note that
assert*.sh → console_results.shacross 10 modules is acyclic and deliberate, mandated by the fork-free hot path — that one should not be "fixed".