testsuite batch93: set -x tracing — for/case headers, per-iteration, temp-env assignments - #304
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three
set -x(xtrace) divergences from bash (set-x.tests):for NAME in WORDSre-emitted per iteration (was once for the whole loop).case WORD innow traced (+ case WORD in).foo=one echo $foo→+ foo=one/+ echo onetwo).Scoreboard
set-x34 → 22 (−12)Remaining (separate features)
foo+=twoliteral+=in trace (needs append flag + raw RHS threaded into the assigns vector), BASH_XTRACEFD, array-assignment ANSI-C$'\t'quoting.Verification
Closes #303