run-file () { local spec_name=$1; shift; local spec_file=spec/$spec_name.test.sh; local suite; suite=$(test/sh_spec.py --print-spec-suite $spec_file); local spec_subdir; case $suite in osh) spec_subdir='osh-cpp' ;; ysh) spec_subdir='ysh-cpp' ;; *) die "Invalid suite $suite" ;; esac; local base_dir=_tmp/spec/$spec_subdir; mkdir -v -p $base_dir; sh-spec $spec_file --timeout 10 --oils-bin-dir $PWD/bin --oils-cpp-bin-dir $REPO_ROOT/_bin/cxx-asan --tsv-output $base_dir/${spec_name}.tsv "$@" } builtin-vars: spec test case results

Results for builtin-vars.test.sh

statusoshosh-cpp
pass 3737
ok 33
FAIL 11
total4141
caseoshosh-cppdescription
0pass pass Export sets a global variable
1pass pass Export sets a global variable that persists after export -n
2pass pass export -n undefined is ignored
3pass pass export -n foo=bar not allowed
4pass pass Export a global variable and unset it
5pass pass Export existing global variables
6pass pass Export existing local variable
7pass pass Export a local that shadows a global
8pass pass Export a variable before defining it
9pass pass Unset exported variable, then define it again. It's NOT still exported.
10pass pass Exporting a parent func variable (dynamic scope)
11pass pass Dependent export setting
12pass pass Exporting a variable doesn't change it
13ok ok can't export array (strict_array)
detailsdetails
14ok ok can't export associative array (strict_array)
detailsdetails
15pass pass assign to readonly variable
16pass pass Make an existing local variable readonly
17pass pass assign to readonly variable - errexit
18pass pass Unset a variable
19pass pass Unset exit status
20pass pass Unset nonexistent variable
21pass pass Unset readonly variable
22pass pass Unset a function without -f
23pass pass Unset has dynamic scope
24pass pass Unset and scope (bug #653)
25pass pass unset of local reveals variable in higher scope
26pass pass Unset invalid variable name
27pass pass Unset nonexistent variable
28pass pass Unset -v
29pass pass Unset -f
30pass pass Unset array member
31pass pass Unset errors
32ok ok Unset wrong type
detailsdetails
33pass pass unset -v assoc (related to issue #661)
34pass pass unset assoc errors
35pass pass Unset array member with dynamic parsing
36pass pass Use local twice
37pass pass Local without variable is still unset!
38FAIL FAIL local after readonly
detailsdetails
39pass pass unset a[-1] (bf.bash regression)
40pass pass unset a[-1] in sparse array (bf.bash regression)
74 passed, 6 OK, 0 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh13 can't export array (strict_array)

stdout:
stderr: 
  export a
         ^
[ stdin ]:6: fatal: Only strings can be exported (strict_array)
osh-cpp13 can't export array (strict_array)

stdout:
stderr: 
  export a
         ^
[ stdin ]:6: fatal: Only strings can be exported (strict_array)
osh14 can't export associative array (strict_array)

stdout:
stderr: 
  export a
         ^
[ stdin ]:6: fatal: Only strings can be exported (strict_array)
osh-cpp14 can't export associative array (strict_array)

stdout:
stderr: 
  export a
         ^
[ stdin ]:6: fatal: Only strings can be exported (strict_array)
osh32 Unset wrong type

stdout:
undef 1
undef 1
array 0
array 0
assoc 0
assoc 0
stderr:
  unset -v 'undef[1]'
           ^
[ stdin ]:4: 'undef' isn't an array
  unset -v 'undef["key"]'
           ^
[ stdin ]:6: 'undef' isn't an array
osh-cpp32 Unset wrong type

stdout:
undef 1
undef 1
array 0
array 0
assoc 0
assoc 0
stderr:
  unset -v 'undef[1]'
           ^
[ stdin ]:4: 'undef' isn't an array
  unset -v 'undef["key"]'
           ^
[ stdin ]:6: 'undef' isn't an array
osh38 local after readonly

[osh stdout] Expected u'', got 'y=0\ny=\n'
[osh status] Expected 1, got 0

stdout:
y=0
y=
stderr:
osh-cpp38 local after readonly

[osh-cpp stdout] Expected u'', got 'y=0\ny=\n'
[osh-cpp status] Expected 1, got 0

stdout:
y=0
y=
stderr: