Results for xtrace.test.sh

statusbashdashashzshmkshkshtoyshsushbrushosh
pass 1149477331215
ok 7600800003
N-I 0700300000
BUG 1200100000
FAIL 001015012161671
total19191919191919191919
casebashdashashzshmkshkshtoyshsushbrushoshdescription
0pass BUG pass FAIL pass pass FAIL FAIL pass pass unset PS4
detailsdetailsdetailsdetails
1ok pass pass pass pass pass FAIL FAIL FAIL FAIL set -o verbose prints unevaluated code
detailsdetailsdetailsdetailsdetails
2ok N-I FAIL FAIL BUG FAIL FAIL FAIL FAIL pass xtrace with unprintable chars
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
3pass N-I FAIL FAIL pass pass FAIL FAIL pass pass xtrace with unicode chars
detailsdetailsdetailsdetailsdetails
4pass pass pass FAIL pass pass FAIL FAIL pass pass xtrace with paths
detailsdetailsdetails
5BUG N-I FAIL FAIL pass pass FAIL FAIL pass pass xtrace with tabs
detailsdetailsdetailsdetailsdetailsdetails
6ok BUG FAIL FAIL ok FAIL FAIL FAIL FAIL pass xtrace with whitespace, quotes, and backslash
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
7ok N-I FAIL FAIL pass pass FAIL FAIL pass pass xtrace with newlines
detailsdetailsdetailsdetailsdetailsdetails
8pass pass pass FAIL ok FAIL FAIL FAIL pass pass xtrace written before command executes
detailsdetailsdetailsdetailsdetails
9ok ok FAIL FAIL ok FAIL FAIL FAIL pass pass Assignments and assign builtins
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
10ok N-I FAIL FAIL N-I FAIL FAIL FAIL FAIL pass [[ ]]
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
11pass ok pass FAIL ok FAIL FAIL FAIL FAIL ok PS4 is scoped
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
12pass ok FAIL FAIL ok FAIL FAIL FAIL pass ok xtrace with variables in PS4
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
13pass ok pass pass ok FAIL pass pass pass pass PS4 with unterminated ${
detailsdetailsdetails
14pass ok pass pass ok FAIL pass pass pass pass PS4 with unterminated $(
detailsdetailsdetails
15pass ok pass pass ok FAIL pass pass FAIL pass PS4 with runtime error
detailsdetailsdetailsdetails
16pass pass pass FAIL pass pass FAIL FAIL pass ok Reading $? in PS4
detailsdetailsdetailsdetails
17ok N-I FAIL FAIL N-I FAIL FAIL FAIL FAIL pass Regression: xtrace for "declare -a a+=(v)"
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
18pass N-I FAIL FAIL N-I FAIL FAIL FAIL pass pass Regression: xtrace for "a+=(v)"
detailsdetailsdetailsdetailsdetailsdetailsdetails
75 passed, 24 OK, 10 not implemented, 4 BUG, 77 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

dash0 unset PS4

stdout:
weird bug
stderr:
zsh0 unset PS4

[zsh stderr] Expected '+ echo 1\n+ unset PS4\necho 2\n', got '+zsh:4> echo 1\n+zsh:5> unset PS4\necho 2\n'

stdout:
1
2
stderr:
+zsh:4> echo 1
+zsh:5> unset PS4
echo 2
toysh0 unset PS4

[toysh stdout] Expected '1\n2\n', got ''
[toysh stderr] Expected '+ echo 1\n+ unset PS4\necho 2\n', got 'munmap_chunk(): invalid pointer\n'
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush0 unset PS4

[sush stderr] Expected '+ echo 1\n+ unset PS4\necho 2\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: set: -x: invalid option\n'

stdout:
1
2
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: set: -x: invalid option
bash1 set -o verbose prints unevaluated code

stdout:
foo
bar
stderr:
x=foo
y=bar
echo $x
echo $(echo $y)
toysh1 set -o verbose prints unevaluated code

[toysh stderr] Expected 'x=foo\ny=bar\necho $x\necho $(echo $y)\n', got 'set: bad -o verbose\n'

stdout:
foo
bar
stderr:
set: bad -o verbose
sush1 set -o verbose prints unevaluated code

[sush stderr] Expected 'x=foo\ny=bar\necho $x\necho $(echo $y)\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: verbose: invalid option name\n'

stdout:
foo
bar
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: verbose: invalid option name
brush1 set -o verbose prints unevaluated code

[brush stderr] Expected 'x=foo\ny=bar\necho $x\necho $(echo $y)\n', got ''

stdout:
foo
bar
stderr:
osh1 set -o verbose prints unevaluated code

[osh stderr] Expected 'x=foo\ny=bar\necho $x\necho $(echo $y)\n', got 'osh warning: set -o verbose not implemented\n'

stdout:
foo
bar
stderr:
osh warning: set -o verbose not implemented
bash2 xtrace with unprintable chars

stdout:
abc
stderr:
+ echo $'a\003b\004c'
dash2 xtrace with unprintable chars

stdout:
stderr: 
ash2 xtrace with unprintable chars

[ash stdout] Expected 'a\x03b\x04c\x00d\n', got 'a\x03b\x04cd\n'
[ash stderr] Expected "+ echo $'a\\u0003b\\u0004c\\u0000d'\n", got "+ echo 'a\x03b\x04cd'\n"

stdout:
abcd
stderr:
+ echo 'abcd'
zsh2 xtrace with unprintable chars

[zsh stderr] Expected "+ echo $'a\\u0003b\\u0004c\\u0000d'\n", got '+zsh:5> echo a\x03b\x04c\x00d\n'

stdout:
abcd
stderr:
+zsh:5> echo abcd
mksh2 xtrace with unprintable chars

stdout:
a;c
stderr:
+ echo $'a;\004c\r'
ksh2 xtrace with unprintable chars

[ksh stdout] Expected 'a\x03b\x04c\x00d\n', got 'a;\x04c\r\n'
[ksh stderr] Expected "+ echo $'a\\u0003b\\u0004c\\u0000d'\n", got "+ echo $'a;\\004c\\r'\n"

stdout:
a;c
stderr:
+ echo $'a;\004c\r'
toysh2 xtrace with unprintable chars

[toysh stdout] Expected 'a\x03b\x04c\x00d\n', got ''
[toysh stderr] Expected "+ echo $'a\\u0003b\\u0004c\\u0000d'\n", got 'main: line 1: sh: syntax error: (\n'
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush2 xtrace with unprintable chars

[sush stdout] Expected 'a\x03b\x04c\x00d\n', got ''
[sush stderr] Expected "+ echo $'a\\u0003b\\u0004c\\u0000d'\n", got "/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: set: xtrace: invalid option name\n\nthread 'main' panicked at src/proc_ctrl.rs:181:46:\ncalled `Result::unwrap()` on an `Err` value: NulError(5, [97, 3, 98, 4, 99, 0, 100])\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n"
[sush status] Expected 0, got 101

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: set: xtrace: invalid option name

thread 'main' panicked at src/proc_ctrl.rs:181:46:
called `Result::unwrap()` on an `Err` value: NulError(5, [97, 3, 98, 4, 99, 0, 100])
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
brush2 xtrace with unprintable chars

[brush stderr] Expected "+ echo $'a\\u0003b\\u0004c\\u0000d'\n", got "+ echo $'a\\003b\\004c\\000d'\n"

stdout:
abcd
stderr:
+ echo $'a\003b\004c\000d'
dash3 xtrace with unicode chars

stdout:
stderr: 
ash3 xtrace with unicode chars

[ash stdout] Expected '[\xce\xbc] [\xce\xbc]\n', got '[\xce\xbc] [\\u03bc]\n'
[ash stderr] Expected "+ echo '[\xce\xbc]' '[\xce\xbc]'\n", got "+ echo '[\xce\xbc]' '[\\u03bc]'\n"

stdout:
[μ] [\u03bc]
stderr:
+ echo '[μ]' '[\u03bc]'
zsh3 xtrace with unicode chars

[zsh stderr] Expected "+ echo '[\xce\xbc]' '[\xce\xbc]'\n", got "+zsh:7> echo '[\xce\xbc]' '[\xce\xbc]'\n"

stdout:
[μ] [μ]
stderr:
+zsh:7> echo '[μ]' '[μ]'
toysh3 xtrace with unicode chars

[toysh stdout] Expected '[\xce\xbc] [\xce\xbc]\n', got ''
[toysh stderr] Expected "+ echo '[\xce\xbc]' '[\xce\xbc]'\n", got 'main: line 1: sh: syntax error: (\n'
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush3 xtrace with unicode chars

[sush stderr] Expected "+ echo '[\xce\xbc]' '[\xce\xbc]'\n", got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: set: xtrace: invalid option name\n'

stdout:
[μ] [μ]
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: set: xtrace: invalid option name
zsh4 xtrace with paths

[zsh stderr] Expected '+ echo my-dir/my_file.cc\n', got '+zsh:2> echo my-dir/my_file.cc\n'

stdout:
my-dir/my_file.cc
stderr:
+zsh:2> echo my-dir/my_file.cc
toysh4 xtrace with paths

[toysh stderr] Expected '+ echo my-dir/my_file.cc\n', got ''

stdout:
my-dir/my_file.cc
stderr:
sush4 xtrace with paths

[sush stderr] Expected '+ echo my-dir/my_file.cc\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: xtrace: invalid option name\n'

stdout:
my-dir/my_file.cc
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: xtrace: invalid option name
bash5 xtrace with tabs

stdout:
[	]
stderr:
+ echo '[	]'
dash5 xtrace with tabs

stdout:
stderr: 
ash5 xtrace with tabs

[ash stderr] Expected "+ echo $'[\\t]'\n", got "+ echo '[\t]'\n"

stdout:
[	]
stderr:
+ echo '[	]'
zsh5 xtrace with tabs

[zsh stderr] Expected "+ echo $'[\\t]'\n", got "+zsh:4> echo '[\t]'\n"

stdout:
[	]
stderr:
+zsh:4> echo '[	]'
toysh5 xtrace with tabs

[toysh stdout] Expected u'[\t]\n', got ''
[toysh stderr] Expected "+ echo $'[\\t]'\n", got 'main: line 1: sh: syntax error: (\n'
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush5 xtrace with tabs

[sush stderr] Expected "+ echo $'[\\t]'\n", got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: set: xtrace: invalid option name\n'

stdout:
[	]
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: set: xtrace: invalid option name
bash6 xtrace with whitespace, quotes, and backslash

stdout:
1 2 ' " \
stderr:
+ echo '1 2' \' '"' '\'
dash6 xtrace with whitespace, quotes, and backslash

stdout:
1 2 ' " \
stderr:
+ echo 1 2 ' " \
ash6 xtrace with whitespace, quotes, and backslash

[ash stderr] Expected '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n', got '+ echo \'1 2\' \'\'"\'" \'"\' \'\\\'\n'

stdout:
1 2 ' " \
stderr:
+ echo '1 2' ''"'" '"' '\'
zsh6 xtrace with whitespace, quotes, and backslash

[zsh stderr] Expected '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n', got '+zsh:2> echo \'1 2\' \\\' \'"\' \'\\\'\n'

stdout:
1 2 ' " \
stderr:
+zsh:2> echo '1 2' \' '"' '\'
mksh6 xtrace with whitespace, quotes, and backslash

stdout:
1 2 ' " \
stderr:
+ echo '1 2' \' '"' '\'
ksh6 xtrace with whitespace, quotes, and backslash

[ksh stderr] Expected '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n', got '+ echo \'1 2\' \\\' \'"\' \'\\\'\n'

stdout:
1 2 ' " \
stderr:
+ echo '1 2' \' '"' '\'
toysh6 xtrace with whitespace, quotes, and backslash

[toysh stderr] Expected '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n', got ''

stdout:
1 2 ' " \
stderr:
sush6 xtrace with whitespace, quotes, and backslash

[sush stderr] Expected '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: xtrace: invalid option name\n'

stdout:
1 2 ' " \
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: xtrace: invalid option name
brush6 xtrace with whitespace, quotes, and backslash

[brush stderr] Expected '+ echo \'1 2\' $\'\\\'\' \'"\' $\'\\\\\'\n', got '+ echo \'1 2\' \\\' \'"\' \'\\\'\n'

stdout:
1 2 ' " \
stderr:
+ echo '1 2' \' '"' '\'
bash7 xtrace with newlines

stdout:
[
]
stderr:
+ echo '[
]'
dash7 xtrace with newlines

stdout:
$[
]
stderr:
+ echo $[\n]
ash7 xtrace with newlines

[ash stderr] Expected "+ echo $'[\\n]'\n", got "+ echo '[\n]'\n"

stdout:
[
]
stderr:
+ echo '[
]'
zsh7 xtrace with newlines

[zsh stderr] Expected "+ echo $'[\\n]'\n", got "+zsh:2> echo '[\n]'\n"

stdout:
[
]
stderr:
+zsh:2> echo '[
]'
toysh7 xtrace with newlines

[toysh stderr] Expected "+ echo $'[\\n]'\n", got " echo $'[\\n]' \n"

stdout:
[
]
stderr:
 echo $'[\n]' 
sush7 xtrace with newlines

[sush stderr] Expected "+ echo $'[\\n]'\n", got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option\n'

stdout:
[
]
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option
zsh8 xtrace written before command executes

[zsh stderr] Expected '+ echo one\none\n+ echo two\ntwo\n', got '+zsh:2> echo one\none\n+zsh:3> echo two\ntwo\n'

stdout:
stderr: 
+zsh:2> echo one
one
+zsh:3> echo two
two
mksh8 xtrace written before command executes

stdout:
stderr: 
+ >&2 
+ echo one
one
+ >&2 
+ echo two
two
ksh8 xtrace written before command executes

[ksh stderr] Expected '+ echo one\none\n+ echo two\ntwo\n', got '+ >&2 \n+ echo one\none\n+ >&2 \n+ echo two\ntwo\n'

stdout:
stderr: 
+ >&2 
+ echo one
one
+ >&2 
+ echo two
two
toysh8 xtrace written before command executes

[toysh stderr] Expected '+ echo one\none\n+ echo two\ntwo\n', got ' echo one >& 2 \none\n echo two >& 2 \ntwo\n'

stdout:
stderr: 
 echo one >& 2 
one
 echo two >& 2 
two
sush8 xtrace written before command executes

[sush stderr] Expected '+ echo one\none\n+ echo two\ntwo\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option\none\ntwo\n'

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option
one
two
bash9 Assignments and assign builtins

stdout:
2
stderr:
+ x=1
+ x=2
+ echo 2
+ readonly x=3
+ x=3
dash9 Assignments and assign builtins

stdout:
2
stderr:
+ x=1 x=2
+ echo 2
+ readonly x=3
ash9 Assignments and assign builtins

[ash stderr] Expected '+ x=1\n+ x=2\n+ echo 2\n+ readonly x=3\n', got "+ x=1 x=2\n+ echo 2\n+ readonly 'x=3'\n"

stdout:
2
stderr:
+ x=1 x=2
+ echo 2
+ readonly 'x=3'
zsh9 Assignments and assign builtins

[zsh stderr] Expected '+ x=1\n+ x=2\n+ echo 2\n+ readonly x=3\n', got '+zsh:2> x=1 x=2 \n+zsh:2> echo 2\n+zsh:2> readonly x=3\n'

stdout:
2
stderr:
+zsh:2> x=1 x=2 
+zsh:2> echo 2
+zsh:2> readonly x=3
mksh9 Assignments and assign builtins

stdout:
2
stderr:
+ x=1 x=2 
+ echo 2
+ readonly 'x=3'
ksh9 Assignments and assign builtins

[ksh stderr] Expected '+ x=1\n+ x=2\n+ echo 2\n+ readonly x=3\n', got "+ x=1 x=2 \n+ echo 2\n+ readonly 'x=3'\n"

stdout:
2
stderr:
+ x=1 x=2 
+ echo 2
+ readonly 'x=3'
toysh9 Assignments and assign builtins

[toysh stderr] Expected '+ x=1\n+ x=2\n+ echo 2\n+ readonly x=3\n', got ' x=1 x=2 \n echo $x \n readonly x=3 \nsh: readonly: No such file or directory\n'
[toysh status] Expected 0, got 127

stdout:
2
stderr:
 x=1 x=2 
 echo $x 
 readonly x=3 
sh: readonly: No such file or directory
sush9 Assignments and assign builtins

[sush stderr] Expected '+ x=1\n+ x=2\n+ echo 2\n+ readonly x=3\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option\n'

stdout:
2
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option
bash10 [[ ]]

stdout:
stderr: 
+ dir=/
+ [[ -d / ]]
+ ((  a = 42  ))
dash10 [[ ]]

stdout:
stderr: 
ash10 [[ ]]

[ash stderr] Expected '+ dir=/\n+ [[ -d $dir ]]\n+ (( a = 42 ))\n', got "+ dir=/\n+ '[[' -d / ]]\n+ a '=' 42\nash: a: not found\n"
[ash status] Expected 0, got 127

stdout:
stderr: 
+ dir=/
+ '[[' -d / ]]
+ a '=' 42
ash: a: not found
zsh10 [[ ]]

[zsh stderr] Expected '+ dir=/\n+ [[ -d $dir ]]\n+ (( a = 42 ))\n', got '+zsh:5> dir=/ \n+zsh:6> [[ -d / ]]\n+zsh:7> (( a = 42 ))\n'

stdout:
stderr: 
+zsh:5> dir=/ 
+zsh:6> [[ -d / ]]
+zsh:7> ((  a = 42  ))
mksh10 [[ ]]

stdout:
stderr: 
ksh10 [[ ]]

[ksh stderr] Expected '+ dir=/\n+ [[ -d $dir ]]\n+ (( a = 42 ))\n', got "+ dir=/ \n+ let ' a = 42 '\n"

stdout:
stderr: 
+ dir=/ 
+ let ' a = 42 '
toysh10 [[ ]]

[toysh stderr] Expected '+ dir=/\n+ [[ -d $dir ]]\n+ (( a = 42 ))\n', got 'main: line 1: sh: syntax error: (\n'
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush10 [[ ]]

[sush stderr] Expected '+ dir=/\n+ [[ -d $dir ]]\n+ (( a = 42 ))\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: set: -x: invalid option\n'

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: set: -x: invalid option
brush10 [[ ]]

[brush stderr] Expected '+ dir=/\n+ [[ -d $dir ]]\n+ (( a = 42 ))\n', got '+ dir=/\n+ [[ -d / ]]\n+ (( a = 42 ))\n'

stdout:
stderr: 
+ dir=/
+ [[ -d / ]]
+ (( a = 42 ))
dash11 PS4 is scoped

stdout:
one
func
two
stderr:
+ echo one
+ f
+ local PS4=- 
- echo func
+ echo two
zsh11 PS4 is scoped

[zsh stderr] Expected "+ echo one\n+ f\n+ local 'PS4=- '\n- echo func\n+ echo two\n" Got "+zsh:2> echo one\n+zsh:7> f\n+f:1> local PS4='- '\n- echo func\n+zsh:8> echo two\n"

stdout:
one
func
two
stderr:
+zsh:2> echo one
+zsh:7> f
+f:1> local PS4='- '
- echo func
+zsh:8> echo two
mksh11 PS4 is scoped

stdout:
one
func
two
stderr:
+ echo one
+ f
+ typeset 'PS4=- '
- echo func
+ echo two
ksh11 PS4 is scoped

[ksh stderr] Expected "+ echo one\n+ f\n+ local 'PS4=- '\n- echo func\n+ echo two\n" Got "+ echo one\n+ f\n+ typeset 'PS4=- '\n- echo func\n+ echo two\n"

stdout:
one
func
two
stderr:
+ echo one
+ f
+ typeset 'PS4=- '
- echo func
+ echo two
toysh11 PS4 is scoped

[toysh stderr] Expected "+ echo one\n+ f\n+ local 'PS4=- '\n- echo func\n+ echo two\n" Got " echo one \n f \n { \n local PS4='- ' \n echo func \n echo two \n"

stdout:
one
func
two
stderr:
 echo one 
 f 
 { 
 local PS4='- ' 
 echo func 
 echo two 
sush11 PS4 is scoped

[sush stderr] Expected "+ echo one\n+ f\n+ local 'PS4=- '\n- echo func\n+ echo two\n" Got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option\n'

stdout:
one
func
two
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: -x: invalid option
brush11 PS4 is scoped

[brush stderr] Expected "+ echo one\n+ f\n+ local 'PS4=- '\n- echo func\n+ echo two\n" Got "+ echo one\n+ f\n+ local PS4='- '\n- echo func\n+ echo two\n"

stdout:
one
func
two
stderr:
+ echo one
+ f
+ local PS4='- '
- echo func
+ echo two
osh11 PS4 is scoped

stdout:
one
func
two
stderr:
+ echo one
+ f
+ local PS4='- '
- echo func
+ echo two
dash12 xtrace with variables in PS4

stdout:
one
two
stderr:
+1:x=1
+1:echo one
+2:x=2
+2:echo two
ash12 xtrace with variables in PS4

[ash stderr] Expected '+:x=1\n+1:echo one\n+1:x=2\n+2:echo two\n', got '+1:x=1\n+1:echo one\n+2:x=2\n+2:echo two\n'

stdout:
one
two
stderr:
+1:x=1
+1:echo one
+2:x=2
+2:echo two
zsh12 xtrace with variables in PS4

[zsh stderr] Expected '+:x=1\n+1:echo one\n+1:x=2\n+2:echo two\n', got '+$x:x=1 \n+$x:echo one\n+$x:x=2 \n+$x:echo two\n'

stdout:
one
two
stderr:
+$x:x=1 
+$x:echo one
+$x:x=2 
+$x:echo two
mksh12 xtrace with variables in PS4

stdout:
one
two
stderr:
+:x=1 
+1:echo one
+1:x=2 
+2:echo two
ksh12 xtrace with variables in PS4

[ksh stderr] Expected '+:x=1\n+1:echo one\n+1:x=2\n+2:echo two\n', got '+:x=1 \n+1:echo one\n+1:x=2 \n+2:echo two\n'

stdout:
one
two
stderr:
+:x=1 
+1:echo one
+1:x=2 
+2:echo two
toysh12 xtrace with variables in PS4

[toysh stderr] Expected '+:x=1\n+1:echo one\n+1:x=2\n+2:echo two\n', got ''

stdout:
one
two
stderr:
sush12 xtrace with variables in PS4

[sush stderr] Expected '+:x=1\n+1:echo one\n+1:x=2\n+2:echo two\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: set: xtrace: invalid option name\n'

stdout:
one
two
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: set: xtrace: invalid option name
osh12 xtrace with variables in PS4

stdout:
one
two
stderr:
+1:x=1
+1:echo one
+2:x=2
+2:echo two
dash13 PS4 with unterminated ${

stdout:
stderr: 
dash: 1: Syntax error: Missing '}'
mksh13 PS4 with unterminated ${

stdout:
stderr: 
mksh: no closing quote
ksh13 PS4 with unterminated ${

[ksh stdout] Expected 'one\nstatus=0\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
E: ksh: no closing quote
dash14 PS4 with unterminated $(

stdout:
stderr: 
dash: 1: Syntax error: end of file unexpected (expecting ")")
mksh14 PS4 with unterminated $(

stdout:
stderr: 
mksh: syntax error: '(' unmatched
ksh14 PS4 with unterminated $(

[ksh stdout] Expected 'one\nstatus=0\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
E: ksh: syntax error: unmatched '('
dash15 PS4 with runtime error

stdout:
stderr: 
dash: 4: arithmetic expression: division by zero: " 1 / 0 "
mksh15 PS4 with runtime error

stdout:
stderr: 
mksh: <stdin>[4]:  1 / 0 : zero divisor
ksh15 PS4 with runtime error

[ksh stdout] Expected 'one\nstatus=0\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
W: ksh: <stdin>[4]:  1 / 0 : zero divisor
brush15 PS4 with runtime error

[brush stdout] Expected 'one\nstatus=0\n', got ''
[brush status] Expected 0, got 1

stdout:
stderr: 
ERROR error: arithmetic evaluation error: division by zero
ERROR error: arithmetic evaluation error: division by zero
zsh16 Reading $? in PS4

[zsh stderr] Expected '[last=0] false\n[last=1] echo ok\n', got '[last=$?] false\n[last=$?] echo ok\n'

stdout:
ok
stderr:
[last=$?] false
[last=$?] echo ok
toysh16 Reading $? in PS4

[toysh stderr] Expected '[last=0] false\n[last=1] echo ok\n', got 'last=$?] false \nlast=$?] echo ok \n'

stdout:
ok
stderr:
last=$?] false 
last=$?] echo ok 
sush16 Reading $? in PS4

[sush stderr] Expected '[last=0] false\n[last=1] echo ok\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: set: -x: invalid option\n'

stdout:
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: set: -x: invalid option
osh16 Reading $? in PS4

stdout:
ok
stderr:
[last=0] 'false'
[last=1] echo ok
bash17 Regression: xtrace for "declare -a a+=(v)"

stdout:
stderr: 
+ a+=('2')
+ declare a
dash17 Regression: xtrace for "declare -a a+=(v)"

stdout:
stderr: 
ash17 Regression: xtrace for "declare -a a+=(v)"

[ash stderr] Expected '+ declare a+=(2)\n', got 'ash: syntax error: unexpected "("\n'
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh17 Regression: xtrace for "declare -a a+=(v)"

[zsh stderr] Expected '+ declare a+=(2)\n', got '+zsh:5> declare a+=( 2 )\ndeclare: not valid in this context: a+\n'
[zsh status] Expected 0, got 1

stdout:
stderr: 
+zsh:5> declare a+=( 2 )
declare: not valid in this context: a+
mksh17 Regression: xtrace for "declare -a a+=(v)"

stdout:
stderr: 
ksh17 Regression: xtrace for "declare -a a+=(v)"

[ksh stderr] Expected '+ declare a+=(2)\n', got "E: ksh: <stdin>[5]: syntax error: unexpected '('\n"
[ksh status] Expected 0, got 1

stdout:
stderr: 
E: ksh: <stdin>[5]: syntax error: unexpected '('
toysh17 Regression: xtrace for "declare -a a+=(v)"

[toysh stderr] Expected '+ declare a+=(2)\n', got 'munmap_chunk(): invalid pointer\n'
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush17 Regression: xtrace for "declare -a a+=(v)"

[sush stderr] Expected '+ declare a+=(2)\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: set: -x: invalid option\n'

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: set: -x: invalid option
brush17 Regression: xtrace for "declare -a a+=(v)"

[brush stderr] Expected '+ declare a+=(2)\n', got "+ declare a+='(2)'\n"

stdout:
stderr: 
+ declare a+='(2)'
dash18 Regression: xtrace for "a+=(v)"

stdout:
stderr: 
ash18 Regression: xtrace for "a+=(v)"

[ash stderr] Expected '+ a+=(2)\n', got 'ash: syntax error: unexpected "("\n'
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh18 Regression: xtrace for "a+=(v)"

[zsh stderr] Expected '+ a+=(2)\n', got '+zsh:5> a+=( 2 ) \n'

stdout:
stderr: 
+zsh:5> a+=( 2 ) 
mksh18 Regression: xtrace for "a+=(v)"

stdout:
stderr: 
ksh18 Regression: xtrace for "a+=(v)"

[ksh stderr] Expected '+ a+=(2)\n', got '+ set -A a+ -- 2\n'

stdout:
stderr: 
+ set -A a+ -- 2
toysh18 Regression: xtrace for "a+=(v)"

[toysh stderr] Expected '+ a+=(2)\n', got 'munmap_chunk(): invalid pointer\n'
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush18 Regression: xtrace for "a+=(v)"

[sush stderr] Expected '+ a+=(2)\n', got '/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: set: -x: invalid option\n'
[sush status] Expected 0, got 2

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: set: -x: invalid option