Results for assign-extended.test.sh

statusoshosh_.pyosh_.cc
pass 323213
ok 111
N-I 110
FAIL 0020
total343434
caseoshosh_.pyosh_.ccdescription
0pass pass pass local -a
1pass pass pass declare -a
2N-I N-I FAIL indexed LHS with spaces (not allowed in OSH)
detailsdetailsdetails
3pass pass FAIL declare -f exit code indicates function existence
details
4pass pass pass declare -F prints function names
5pass pass FAIL declare -p var (exit status)
details
6pass pass FAIL declare
details
7pass pass FAIL declare -p
details
8pass pass FAIL declare -p var
details
9pass pass pass declare -p arr
10pass pass FAIL declare -p foo=bar doesn't make sense
details
11pass pass FAIL declare -pnrx
details
12pass pass FAIL declare -paA
details
13pass pass FAIL declare -pnrx var
details
14pass pass FAIL declare -pg
details
15pass pass FAIL declare -pg var
details
16pass pass FAIL ble.sh: eval -- "$(declare -p var arr)"
details
17pass pass FAIL eval -- "$(declare -p arr)" (restore arrays w/ unset elements)
details
18pass pass FAIL typeset -f
details
19pass pass FAIL typeset -p
details
20pass pass pass typeset -r makes a string readonly
21pass pass pass typeset -ar makes it readonly
22pass pass FAIL typeset -x makes it exported
details
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 pass pass declare -g (bash-specific; bash-completion uses it)
27ok ok ok myvar=typeset (another form of dynamic assignment)
detailsdetailsdetails
28pass pass FAIL dynamic array parsing is not allowed
details
29pass pass FAIL dynamic flag in array in assign builtin
details
30pass pass FAIL typeset +x
details
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
77 passed, 3 OK, 2 not implemented, 0 BUG, 20 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

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)

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

[osh_.cc stdout] Expected 'status=127\n[]\n', got '[]\nstatus=127\n'

stdout:
[]
status=127
stderr:
  a[1 * 1]=x a[ 1 + 2 ]=z
  ^~
[ stdin ]:1: 'a[1' not found

dumb_alloc:
	gNumNew = 2238
	gNumDelete = 202
	gMemPos = 76064

	gNumMalloc = 226
	gNumFree = 0
	gMemPos2 = 12832
osh_.cc3 declare -f exit code indicates function existence

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
osh_.cc5 declare -p var (exit status)

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
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 ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
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 ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
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 ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
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 -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
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 ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc12 declare -paA

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
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 ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc14 declare -pg

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc15 declare -pg var

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
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 ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
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 ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:106: Tuple2<int, int> posix::pipe(): Assertion `0' failed.
osh_.cc18 typeset -f

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
osh_.cc19 typeset -p

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

stdout:
stderr: 
osh_eval.opt: cpp/posix.h:143: void posix::dup2(int, int): Assertion `0' failed.
osh_.cc22 typeset -x makes it exported

[osh_.cc stdout] Expected 'lib/\n', got 'None\n'

stdout:
None
stderr:
dumb_alloc:
	gNumNew = 1916
	gNumDelete = 153
	gMemPos = 67376

	gNumMalloc = 113
	gNumFree = 0
	gMemPos2 = 11040
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:
dumb_alloc:
	gNumNew = 1916
	gNumDelete = 155
	gMemPos = 65984

	gNumMalloc = 82
	gNumFree = 0
	gMemPos2 = 10512
osh_.cc28 dynamic array parsing is not allowed

[osh_.cc stdout] Expected "status=2\n['']\n", got "['']\nstatus=2\n"

stdout:
['']
status=2
stderr:
  typeset -a "$code"  # note: -a flag is required
             ^
[ stdin ]:2: 'typeset' Got -a but RHS isn't an array

dumb_alloc:
	gNumNew = 2070
	gNumDelete = 179
	gMemPos = 70832

	gNumMalloc = 145
	gNumFree = 0
	gMemPos2 = 11552
osh_.cc29 dynamic flag in array in assign builtin

[osh_.cc stdout] Expected 'foo=F\nbar=B\nF\nB\n', got 'None\nNone\nfoo=F\nbar=B\n'

stdout:
None
None
foo=F
bar=B
stderr:
dumb_alloc:
	gNumNew = 2621
	gNumDelete = 278
	gMemPos = 86880

	gNumMalloc = 325
	gNumFree = 0
	gMemPos2 = 14432
osh_.cc30 typeset +x

[osh_.cc stdout] Expected 'E\nNone\n', got 'None\nNone\n'

stdout:
None
None
stderr:
dumb_alloc:
	gNumNew = 2073
	gNumDelete = 188
	gMemPos = 71536

	gNumMalloc = 143
	gNumFree = 0
	gMemPos2 = 11520