type-compat () { run-file type-compat "$@" } run-file () { local spec_name=$1; shift; sh-spec spec/$spec_name.test.sh --compare-shells --oils-bin-dir $PWD/bin "$@" } type-compat: spec test case results

Results for type-compat.test.sh

statusbash-4osh
pass 62
ok 10
N-I 05
total77
casebash-4oshdescription
0ok pass declare -i -l -u errors can be silenced - ignore_flags_not_impl
details
1pass N-I declare -i with +=
details
2pass N-I declare -i with arithmetic inside strings (Nix, issue 864)
details
3pass pass append in arith context
4pass N-I declare array vs. string: mixing -a +a and () ''
details
5pass N-I declare array vs. associative array
details
6pass N-I declare -l -u
details
8 passed, 1 OK, 5 not implemented, 0 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

bash-40 declare -i -l -u errors can be silenced - ignore_flags_not_impl

stdout:
status=0
foo=5

status=0
bar=5
stderr:
bash-4.4: line 6: shopt: ignore_flags_not_impl: invalid shell option name
osh1 declare -i with +=

stdout:
[1  2 ]
[1 2 ]
[x 2 ]
stderr:
  declare -i i
  ^~~~~~~
[ stdin ]:5: 'declare' doesn't implement flag -i (shopt --set ignore_flags_not_impl)
  declare -i j
  ^~~~~~~
[ stdin ]:9: 'declare' doesn't implement flag -i (shopt --set ignore_flags_not_impl)
osh2 declare -i with arithmetic inside strings (Nix, issue 864)

stdout:
s=1 + 2
item=array[1+1]
stderr:
  declare -i s
  ^~~~~~~
[ stdin ]:1: 'declare' doesn't implement flag -i (shopt --set ignore_flags_not_impl)
  declare -i item
  ^~~~~~~
[ stdin ]:6: 'declare' doesn't implement flag -i (shopt --set ignore_flags_not_impl)
osh4 declare array vs. string: mixing -a +a and () ''

stdout:
['', '']
stderr:
  declare +a 'xyz1=1'
          ^
[ stdin ]:1: 'declare' doesn't accept option +a
  declare +a 'xyz2=(2 3)'
          ^
[ stdin ]:2: 'declare' doesn't accept option +a
  declare -a 'xyz3=4'
             ^
[ stdin ]:3: 'declare' Got -a but RHS isn't an array
  declare -a 'xyz4=(5 6)'
             ^
[ stdin ]:4: 'declare' Got -a but RHS isn't an array
osh5 declare array vs. associative array

stdout:
['0']
['0']
stderr:
  declare -a 'array=([a]=b [c]=d)'
             ^
[ stdin ]:1: 'declare' Got -a but RHS isn't an array
  declare -A 'assoc=([a]=b [c]=d)'
             ^
[ stdin ]:2: 'declare' Got -A but RHS isn't an associative array
osh6 declare -l -u

stdout:
FOO
foo
stderr:
  declare -l lower=FOO
  ^~~~~~~
[ stdin ]:1: Warning: OSH doesn't implement flags -l or -u (shopt --set ignore_flags_not_impl)
  declare -u upper=foo
  ^~~~~~~
[ stdin ]:2: Warning: OSH doesn't implement flags -l or -u (shopt --set ignore_flags_not_impl)