Results for assign-extended.test.sh

statusoshosh-cpp
pass 3434
ok 11
N-I 11
FAIL 11
total3737
caseoshosh-cppdescription
0pass pass local -a
1pass pass declare -a
2N-I N-I indexed LHS with spaces (not allowed in OSH)
detailsdetails
3pass pass declare -f exit code indicates function existence
4pass pass declare -F prints function names
5FAIL FAIL declare -F with shopt -s extdebug prints more info
detailsdetails
6pass pass declare -p var (exit status)
7pass pass declare
8pass pass declare -p
9pass pass declare -p doesn't print binary data, but can be loaded into bash
10pass pass declare -p var
11pass pass declare -p arr
12pass pass declare -p foo=bar doesn't make sense
13pass pass declare -pnrx
14pass pass declare -paA
15pass pass declare -pnrx var
16pass pass declare -pg
17pass pass declare -pg var
18pass pass ble.sh: eval -- "$(declare -p var arr)"
19pass pass eval -- "$(declare -p arr)" (restore arrays w/ unset elements)
20pass pass typeset -f
21pass pass typeset -p
22pass pass typeset -r makes a string readonly
23pass pass typeset -ar makes it readonly
24pass pass typeset -x makes it exported
25pass pass Multiple assignments / array assignments on a line
26pass pass Env bindings shouldn't contain array assignments
27pass pass syntax error in array assignment
28pass pass declare -g (bash-specific; bash-completion uses it)
29ok ok myvar=typeset (another form of dynamic assignment)
detailsdetails
30pass pass dynamic array parsing is not allowed
31pass pass dynamic flag in array in assign builtin
32pass pass typeset +x
33pass pass typeset +r removes read-only attribute (TODO: documented in bash to do nothing)
34pass pass function name with /
35pass pass invalid var name
36pass pass unset and shell funcs
68 passed, 2 OK, 2 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

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 (OILS-ERR-100)
osh-cpp2 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 (OILS-ERR-100)
osh5 declare -F with shopt -s extdebug prints more info

[osh stdout] Expected 'declare -f add\ndeclare -f g\n\nadd 7 main\ng 3 ROOT/spec/testdata/bash-source-2.sh\n' Got 'declare -f add\ndeclare -f g\n\nadd\ng\n'

stdout:
declare -f add
declare -f g

add
g
stderr:
  shopt -s extdebug
  ^~~~~
[ stdin ]:5: 'shopt' got invalid option 'extdebug'
osh-cpp5 declare -F with shopt -s extdebug prints more info

[osh-cpp stdout] Expected 'declare -f add\ndeclare -f g\n\nadd 7 main\ng 3 ROOT/spec/testdata/bash-source-2.sh\n' Got 'declare -f add\ndeclare -f g\n\nadd\ng\n'

stdout:
declare -f add
declare -f g

add
g
stderr:
  shopt -s extdebug
  ^~~~~
[ stdin ]:5: 'shopt' got invalid option 'extdebug'
osh29 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr:
osh-cpp29 myvar=typeset (another form of dynamic assignment)

stdout:
a b
stderr: