Results for assign-extended.test.sh

statusoshosh_.pyosh_.cc
pass 32108
ok 111
N-I 100
FAIL 02325
total343434
caseoshosh_.pyosh_.ccdescription
0pass FAIL FAIL local -a
detailsdetails
1pass FAIL FAIL declare -a
detailsdetails
2N-I FAIL FAIL indexed LHS with spaces (not allowed in OSH)
detailsdetailsdetails
3pass FAIL FAIL declare -f exit code indicates function existence
detailsdetails
4pass pass FAIL declare -F prints function names
details
5pass FAIL FAIL declare -p var (exit status)
detailsdetails
6pass FAIL FAIL declare
detailsdetails
7pass FAIL FAIL declare -p
detailsdetails
8pass FAIL FAIL declare -p var
detailsdetails
9pass pass FAIL declare -p arr
details
10pass FAIL FAIL declare -p foo=bar doesn't make sense
detailsdetails
11pass FAIL FAIL declare -pnrx
detailsdetails
12pass FAIL FAIL declare -paA
detailsdetails
13pass FAIL FAIL declare -pnrx var
detailsdetails
14pass FAIL FAIL declare -pg
detailsdetails
15pass FAIL FAIL declare -pg var
detailsdetails
16pass FAIL FAIL ble.sh: eval -- "$(declare -p var arr)"
detailsdetails
17pass FAIL FAIL eval -- "$(declare -p arr)" (restore arrays w/ unset elements)
detailsdetails
18pass FAIL FAIL typeset -f
detailsdetails
19pass FAIL FAIL typeset -p
detailsdetails
20pass pass pass typeset -r makes a string readonly
21pass pass pass typeset -ar makes it readonly
22pass FAIL FAIL typeset -x makes it exported
detailsdetails
23pass pass pass Multiple assignments / array assignments on a line
24pass pass pass Env bindings shouldn't contain array assignments
25pass pass pass syntax error in array assignment
26pass FAIL FAIL declare -g (bash-specific; bash-completion uses it)
detailsdetails
27ok ok ok myvar=typeset (another form of dynamic assignment)
detailsdetailsdetails
28pass FAIL FAIL dynamic array parsing is not allowed
detailsdetails
29pass FAIL FAIL dynamic flag in array in assign builtin
detailsdetails
30pass FAIL FAIL typeset +x
detailsdetails
31pass pass pass typeset +r removes read-only attribute (TODO: documented in bash to do nothing)
32pass pass pass function name with /
33pass pass pass invalid var name
50 passed, 3 OK, 1 not implemented, 0 BUG, 48 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh_.py0 local -a

[osh_.py stdout] Expected "['x', 'y', 'z']\n", got '(cmd_value.Argv argv:[argv.py x y z] arg_spids:[21 23 23 23])\n'

stdout:
(cmd_value.Argv argv:[argv.py x y z] arg_spids:[21 23 23 23])
stderr:
Unhandled SimpleCommand
osh_.cc0 local -a

[osh_.cc stdout] Expected "['x', 'y', 'z']\n", got '(cmd_value.Argv argv:[argv.py x y z] arg_spids:[21 23 23 23])\n'

stdout:
(cmd_value.Argv argv:[argv.py x y z] arg_spids:[21 23 23 23])
stderr:
Unhandled SimpleCommand
osh_.py1 declare -a

[osh_.py stdout] Expected "['x', 'y', 'z']\n", got '(cmd_value.Argv argv:[argv.py x y z] arg_spids:[13 15 15 15])\n'

stdout:
(cmd_value.Argv argv:[argv.py x y z] arg_spids:[13 15 15 15])
stderr:
Unhandled SimpleCommand
osh_.cc1 declare -a

[osh_.cc stdout] Expected "['x', 'y', 'z']\n", got '(cmd_value.Argv argv:[argv.py x y z] arg_spids:[13 15 15 15])\n'

stdout:
(cmd_value.Argv argv:[argv.py x y z] arg_spids:[13 15 15 15])
stderr:
Unhandled SimpleCommand
osh2 indexed LHS with spaces (not allowed in OSH)

stdout:
status=127
[]
stderr:
  a[1 * 1]=x a[ 1 + 2 ]=z
  ^~
[ stdin ]:1: 'a[1' not found
osh_.py2 indexed LHS with spaces (not allowed in OSH)

[osh_.py stdout] Expected 'status=127\n[]\n', got "(cmd_value.Argv\n argv: ['a[1' _tmp tmp.txt '1]=x' 'a[' 1 '+' 2 ']=z']\n arg_spids: [0 3 3 5 9 11 13 15 17]\n)\nstatus=0\n(cmd_value.Argv argv:[argv.py] arg_spids:[25])\n"

stdout:
(cmd_value.Argv
  argv: ['a[1' _tmp tmp.txt '1]=x' 'a[' 1 '+' 2 ']=z']
  arg_spids: [0 3 3 5 9 11 13 15 17]
)
status=0
(cmd_value.Argv argv:[argv.py] arg_spids:[25])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc2 indexed LHS with spaces (not allowed in OSH)

[osh_.cc stdout] Expected 'status=127\n[]\n', got "(cmd_value.Argv\n argv: ['a[1' _tmp tmp.txt '1]=x' 'a[' 1 '+' 2 ']=z']\n arg_spids: [0 3 3 5 9 11 13 15 17]\n)\nstatus=0\n(cmd_value.Argv argv:[argv.py] arg_spids:[25])\n"

stdout:
(cmd_value.Argv
  argv: ['a[1' _tmp tmp.txt '1]=x' 'a[' 1 '+' 2 ']=z']
  arg_spids: [0 3 3 5 9 11 13 15 17]
)
status=0
(cmd_value.Argv argv:[argv.py] arg_spids:[25])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.py3 declare -f exit code indicates function existence

[osh_.py stdout] Expected '1\n1\n0\n', got '1\nmyfunc\n1\nmyfunc\nfunc2\n0\n'

stdout:
1
myfunc
1
myfunc
func2
0
stderr:
osh_.cc3 declare -f exit code indicates function existence

[osh_.cc stdout] Expected '1\n1\n0\n', got '1\nmyfunc\n1\nmyfunc\nfunc2\n0\n'

stdout:
1
myfunc
1
myfunc
func2
0
stderr:
osh_.cc4 declare -F prints function names

[osh_.cc stdout] Expected 'declare -f __ec\ndeclare -f _ab\ndeclare -f add\ndeclare -f div\ndeclare -f ek\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: mycpp/mylib.h:926: List<Str *> *sorted(Dict<Str *, V> *) [V = syntax_asdl::command__ShFunction *]: Assertion `0' failed.
osh_.py5 declare -p var (exit status)

[osh_.py stdout] Expected '1\n1\n0\n', got '1\ndeclare -- var1=x\n1\ndeclare -- var1=x\ndeclare -- var2=y\n0\n'

stdout:
1
declare -- var1=x
1
declare -- var1=x
declare -- var2=y
0
stderr:
osh_.cc5 declare -p var (exit status)

[osh_.cc stdout] Expected '1\n1\n0\n', got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: 
osh_.py6 declare

[osh_.py stdout] Expected '[declare]\ntest_var1=111\ntest_var2=222\ntest_var3=333\ntest_var4=test_var1\ntest_var5=555\n[readonly]\ndeclare -r test_var2=222\n[export]\ndeclare -x test_var3=333\n[local]\ntest_var5=555\n', got ''

stdout:
stderr: 
osh_.cc6 declare

[osh_.cc stdout] Expected '[declare]\ntest_var1=111\ntest_var2=222\ntest_var3=333\ntest_var4=test_var1\ntest_var5=555\n[readonly]\ndeclare -r test_var2=222\n[export]\ndeclare -x test_var3=333\n[local]\ntest_var5=555\n', got ''

stdout:
stderr: 
osh_.py7 declare -p

[osh_.py stdout] Expected '[declare]\ndeclare -- test_var1=111\ndeclare -r test_var2=222\ndeclare -x test_var3=333\ndeclare -n test_var4=test_var1\ndeclare -- test_var5=555\n[readonly]\ndeclare -r test_var2=222\n[export]\ndeclare -x test_var3=333\n[local]\ndeclare -- test_var5=555\n', got ''

stdout:
stderr: 
osh_.cc7 declare -p

[osh_.cc stdout] Expected '[declare]\ndeclare -- test_var1=111\ndeclare -r test_var2=222\ndeclare -x test_var3=333\ndeclare -n test_var4=test_var1\ndeclare -- test_var5=555\n[readonly]\ndeclare -r test_var2=222\n[export]\ndeclare -x test_var3=333\n[local]\ndeclare -- test_var5=555\n', got ''

stdout:
stderr: 
osh_.py8 declare -p var

[osh_.py stdout] Expected '[declare]\ndeclare -- test_var1=111\ndeclare -r test_var2=222\ndeclare -x test_var3=333\ndeclare -n test_var4=test_var1\ndeclare -- test_var5=555\n[readonly]\ndeclare -r test_var2=222\n[export]\ndeclare -x test_var3=333\n[local]\ndeclare -- test_var5=555\n', got ''

stdout:
stderr: 
osh_.cc8 declare -p var

[osh_.cc stdout] Expected '[declare]\ndeclare -- test_var1=111\ndeclare -r test_var2=222\ndeclare -x test_var3=333\ndeclare -n test_var4=test_var1\ndeclare -- test_var5=555\n[readonly]\ndeclare -r test_var2=222\n[export]\ndeclare -x test_var3=333\n[local]\ndeclare -- test_var5=555\n', got ''

stdout:
stderr: 
osh_.cc9 declare -p arr

[osh_.cc stdout] Expected "declare -a test_arr1=()\ndeclare -a test_arr2=()\ndeclare -A test_arr3\ndeclare -a test_arr4=(1 2 3)\ndeclare -a test_arr5=(1 2 3)\ndeclare -A test_arr6=(['a']=1 ['b']=2 ['c']=3)\ndeclare -a test_arr7=(); test_arr7[3]=foo\n", got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: 
osh_.py10 declare -p foo=bar doesn't make sense

[osh_.py stdout] Expected 'status=1\nstatus=1\ndeclare -- a=b\n', got 'status=1\ndeclare -- a=b\nstatus=1\n(cmd_value.Argv argv:[sed \'s/"//g\' tmp.txt] arg_spids:[50 52 56])\n'

stdout:
status=1
declare -- a=b
status=1
(cmd_value.Argv argv:[sed 's/"//g' tmp.txt] arg_spids:[50 52 56])
stderr:
Unhandled SimpleCommand
osh_.cc10 declare -p foo=bar doesn't make sense

[osh_.cc stdout] Expected 'status=1\nstatus=1\ndeclare -- a=b\n', got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: 
osh_.py11 declare -pnrx

[osh_.py stdout] Expected '[declare -pn]\ndeclare -n test_var4=test_var1\n[declare -pr]\ndeclare -r test_var2=222\n[declare -px]\ndeclare -x test_var3=333\n', got ''

stdout:
stderr: 
osh_.cc11 declare -pnrx

[osh_.cc stdout] Expected '[declare -pn]\ndeclare -n test_var4=test_var1\n[declare -pr]\ndeclare -r test_var2=222\n[declare -px]\ndeclare -x test_var3=333\n', got ''

stdout:
stderr: 
osh_.py12 declare -paA

[osh_.py stdout] Expected '[declare -pa]\ndeclare -a test_var6=()\n[declare -pA]\ndeclare -A test_var7\n', got ''

stdout:
stderr: 
osh_.cc12 declare -paA

[osh_.cc stdout] Expected '[declare -pa]\ndeclare -a test_var6=()\n[declare -pA]\ndeclare -A test_var7\n', got ''

stdout:
stderr: 
osh_.py13 declare -pnrx var

[osh_.py stdout] Expected '[declare -pn]\ndeclare -n test_var4=test_var1\n[declare -pr]\ndeclare -r test_var2=222\n[declare -px]\ndeclare -x test_var3=333\n', got ''

stdout:
stderr: 
osh_.cc13 declare -pnrx var

[osh_.cc stdout] Expected '[declare -pn]\ndeclare -n test_var4=test_var1\n[declare -pr]\ndeclare -r test_var2=222\n[declare -px]\ndeclare -x test_var3=333\n', got ''

stdout:
stderr: 
osh_.py14 declare -pg

[osh_.py stdout] Expected 'declare -- test_var1=global\n', got ''

stdout:
stderr: 
osh_.cc14 declare -pg

[osh_.cc stdout] Expected 'declare -- test_var1=global\n', got ''

stdout:
stderr: 
osh_.py15 declare -pg var

[osh_.py stdout] Expected 'declare -- test_var1=global\n', got ''

stdout:
stderr: 
osh_.cc15 declare -pg var

[osh_.cc stdout] Expected 'declare -- test_var1=global\n', got ''

stdout:
stderr: 
osh_.py16 ble.sh: eval -- "$(declare -p var arr)"

[osh_.py stdout] Expected 'sum=21\narr[0]=a2\narr[1]=a5\narr[2]=a8\narr[3]=a10\n', got 'sum=\n'

stdout:
sum=
stderr:
osh_.cc16 ble.sh: eval -- "$(declare -p var arr)"

[osh_.cc stdout] Expected 'sum=21\narr[0]=a2\narr[1]=a5\narr[2]=a8\narr[3]=a10\n', got 'sum=\n'

stdout:
sum=
stderr:
osh_.py17 eval -- "$(declare -p arr)" (restore arrays w/ unset elements)

[osh_.py stdout] Expected 'arr[0]: unset\narr[1]: unset\narr[2]: unset\narr[3]: set ... []\narr[4]: set ... [foo]\n', got 'arr[0]: set ... [1]\narr[1]: set ... [2]\narr[2]: set ... [3]\narr[3]: unset\narr[4]: unset\n'

stdout:
arr[0]: set ... [1]
arr[1]: set ... [2]
arr[2]: set ... [3]
arr[3]: unset
arr[4]: unset
stderr:
osh_.cc17 eval -- "$(declare -p arr)" (restore arrays w/ unset elements)

[osh_.cc stdout] Expected 'arr[0]: unset\narr[1]: unset\narr[2]: unset\narr[3]: set ... []\narr[4]: set ... [foo]\n', got 'arr[0]: set ... [1]\narr[1]: set ... [2]\narr[2]: set ... [3]\narr[3]: unset\narr[4]: unset\n'

stdout:
arr[0]: set ... [1]
arr[1]: set ... [2]
arr[2]: set ... [3]
arr[3]: unset
arr[4]: unset
stderr:
osh_.py18 typeset -f

[osh_.py stdout] Expected '1\n1\n0\n', got '1\nmyfunc\n1\nmyfunc\nfunc2\n0\n'

stdout:
1
myfunc
1
myfunc
func2
0
stderr:
osh_.cc18 typeset -f

[osh_.cc stdout] Expected '1\n1\n0\n', got '1\nmyfunc\n1\nmyfunc\nfunc2\n0\n'

stdout:
1
myfunc
1
myfunc
func2
0
stderr:
osh_.py19 typeset -p

[osh_.py stdout] Expected '1\n1\n0\n', got '1\ndeclare -- var1=x\n1\ndeclare -- var1=x\ndeclare -- var2=y\n0\n'

stdout:
1
declare -- var1=x
1
declare -- var1=x
declare -- var2=y
0
stderr:
osh_.cc19 typeset -p

[osh_.cc stdout] Expected '1\n1\n0\n', got ''
[osh_.cc status] Expected 0, got -11

stdout:
stderr: 
osh_.py22 typeset -x makes it exported

[osh_.py stdout] Expected 'lib/\n', got '(cmd_value.Argv argv:[printenv.py PYTHONPATH] arg_spids:[7 9])\n'

stdout:
(cmd_value.Argv argv:[printenv.py PYTHONPATH] arg_spids:[7 9])
stderr:
Unhandled SimpleCommand
osh_.cc22 typeset -x makes it exported

[osh_.cc stdout] Expected 'lib/\n', got '(cmd_value.Argv argv:[printenv.py PYTHONPATH] arg_spids:[7 9])\n'

stdout:
(cmd_value.Argv argv:[printenv.py PYTHONPATH] arg_spids:[7 9])
stderr:
Unhandled SimpleCommand
osh_.py26 declare -g (bash-specific; bash-completion uses it)

[osh_.py stdout] Expected "['42', '']\n['bar', '']\n['ev2']\n", got "(cmd_value.Argv argv:[argv.py 42 ''] arg_spids:[87 89 93])\n(cmd_value.Argv argv:[argv.py bar ''] arg_spids:[97 99 110])\n(cmd_value.Argv argv:[argv.py ev2] arg_spids:[121 123])\n"

stdout:
(cmd_value.Argv argv:[argv.py 42 ''] arg_spids:[87 89 93])
(cmd_value.Argv argv:[argv.py bar ''] arg_spids:[97 99 110])
(cmd_value.Argv argv:[argv.py ev2] arg_spids:[121 123])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc26 declare -g (bash-specific; bash-completion uses it)

[osh_.cc stdout] Expected "['42', '']\n['bar', '']\n['ev2']\n", got '(cmd_value.Argv argv:[argv.py 42 99] arg_spids:[87 89 93])\n(cmd_value.Argv argv:[argv.py bar Eggs] arg_spids:[97 99 110])\n(cmd_value.Argv argv:[argv.py ev2] arg_spids:[121 123])\n'

stdout:
(cmd_value.Argv argv:[argv.py 42 99] arg_spids:[87 89 93])
(cmd_value.Argv argv:[argv.py bar Eggs] arg_spids:[97 99 110])
(cmd_value.Argv argv:[argv.py ev2] arg_spids:[121 123])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh27 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr:
osh_.py27 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr:
osh_.cc27 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr:
osh_.py28 dynamic array parsing is not allowed

[osh_.py stdout] Expected "status=2\n['']\n", got "status=2\n(cmd_value.Argv argv:[argv.py ''] arg_spids:[21 23])\n"

stdout:
status=2
(cmd_value.Argv argv:[argv.py ''] arg_spids:[21 23])
stderr:
  typeset -a "$code"  # note: -a flag is required
             ^
[ stdin ]:2: 'typeset' Got -a but RHS isn't an array
Unhandled SimpleCommand
osh_.cc28 dynamic array parsing is not allowed

[osh_.cc stdout] Expected "status=2\n['']\n", got "status=2\n(cmd_value.Argv argv:[argv.py ''] arg_spids:[21 23])\n"

stdout:
status=2
(cmd_value.Argv argv:[argv.py ''] arg_spids:[21 23])
stderr:
  typeset -a "$code"  # note: -a flag is required
             ^
[ stdin ]:2: 'typeset' Got -a but RHS isn't an array
Unhandled SimpleCommand
osh_.py29 dynamic flag in array in assign builtin

[osh_.py stdout] Expected 'foo=F\nbar=B\nF\nB\n', got 'foo=F\nbar=B\n(cmd_value.Argv argv:[printenv.py foo] arg_spids:[49 51])\n(cmd_value.Argv argv:[printenv.py bar] arg_spids:[53 55])\n'

stdout:
foo=F
bar=B
(cmd_value.Argv argv:[printenv.py foo] arg_spids:[49 51])
(cmd_value.Argv argv:[printenv.py bar] arg_spids:[53 55])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc29 dynamic flag in array in assign builtin

[osh_.cc stdout] Expected 'foo=F\nbar=B\nF\nB\n', got 'foo=F\nbar=B\n(cmd_value.Argv argv:[printenv.py foo] arg_spids:[49 51])\n(cmd_value.Argv argv:[printenv.py bar] arg_spids:[53 55])\n'

stdout:
foo=F
bar=B
(cmd_value.Argv argv:[printenv.py foo] arg_spids:[49 51])
(cmd_value.Argv argv:[printenv.py bar] arg_spids:[53 55])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.py30 typeset +x

[osh_.py stdout] Expected 'E\nNone\n', got '(cmd_value.Argv argv:[printenv.py e] arg_spids:[5 7])\n(cmd_value.Argv argv:[printenv.py e] arg_spids:[17 19])\n'

stdout:
(cmd_value.Argv argv:[printenv.py e] arg_spids:[5 7])
(cmd_value.Argv argv:[printenv.py e] arg_spids:[17 19])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_.cc30 typeset +x

[osh_.cc stdout] Expected 'E\nNone\n', got '(cmd_value.Argv argv:[printenv.py e] arg_spids:[5 7])\n(cmd_value.Argv argv:[printenv.py e] arg_spids:[17 19])\n'

stdout:
(cmd_value.Argv argv:[printenv.py e] arg_spids:[5 7])
(cmd_value.Argv argv:[printenv.py e] arg_spids:[17 19])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand