Skip to content

testsuite batch93: set -x tracing — for/case headers, per-iteration, temp-env assignments - #304

Merged
brianjfox merged 1 commit into
mainfrom
fix/testsuite-batch93
Jul 25, 2026
Merged

testsuite batch93: set -x tracing — for/case headers, per-iteration, temp-env assignments#304
brianjfox merged 1 commit into
mainfrom
fix/testsuite-batch93

Conversation

@brianjfox

Copy link
Copy Markdown
Owner

Summary

Three set -x (xtrace) divergences from bash (set-x.tests):

  1. for NAME in WORDS re-emitted per iteration (was once for the whole loop).
  2. case WORD in now traced (+ case WORD in).
  3. Temporary/standalone assignments traced on their own line, command separate (foo=one echo $foo+ foo=one / + echo onetwo).

Scoreboard

  • set-x 34 → 22 (−12)

Remaining (separate features)

foo+=two literal += in trace (needs append flag + raw RHS threaded into the assigns vector), BASH_XTRACEFD, array-assignment ANSI-C $'\t' quoting.

Verification

  • ctest 22/22
  • run_diff: all 234 scripts match bash
  • Rescan errors/func/varenv/builtins/trap/comsub/dbg-support/cond/arith/nameref: no regressions

Closes #303

Three xtrace (`set -x') divergences surfaced by set-x.tests:

- `for NAME in WORDS' was traced once for the whole loop; bash re-emits
  `+ for NAME in WORDS' before every iteration.  Build the trace string
  once and print it at the top of each iteration.
- `case WORD in' was not traced; emit `+ case WORD in' (expanded word).
- A command's temporary/standalone assignments were traced on the same
  line as the command word list; bash traces each assignment on its own
  line, then the command (if any) on a separate line -- so
  `foo=one echo $foo' traces as `+ foo=one' then `+ echo onetwo'.

set-x 34 -> 22.  Remaining are separate features: the `+=' operator in
an assignment trace (needs the append flag + raw RHS threaded into the
assigns vector), BASH_XTRACEFD, and array-assignment ANSI-C quoting.

Closes #303
@brianjfox
brianjfox merged commit c3c4e08 into main Jul 25, 2026
1 check passed
@brianjfox
brianjfox deleted the fix/testsuite-batch93 branch July 25, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

testsuite batch93: set -x tracing — for/case headers, per-iteration, temp-env assignments

1 participant