Results for ysh-scope.test.sh

statusoshosh_ALT
pass 1919
FAIL 55
total2424
caseoshosh_ALTdescription
0pass pass GetValue scope and shopt --unset dynamic_scope
1pass pass SetValue scope and shopt --unset dynamic_scope
2pass pass read scope
3pass pass printf -v x respects dynamic_scope
4pass pass printf -v a[i] respects dynamic_scope
5pass pass ${undef=a} and shopt --unset dynamic_scope
6pass pass declare -p respects it
7pass pass OshLanguageSetValue constructs
8pass pass shell assignments 'neutered' inside 'proc'
9pass pass setglobal still allows setting globals
10pass pass setglobal d[key] inside proc should mutate global (bug #1841)
11pass pass setglobal a[i] inside proc
12pass pass setglobal a[i] += and d.key +=
13pass pass setglobal a[i] - i can be local or global
14pass pass unset inside proc uses local scope
15pass pass unset composes when you turn on dynamic scope
16pass pass Temp Bindings
17pass pass cd blocks don't introduce new scopes
18FAIL FAIL IFS=: myproc exports when it doesn't need to
detailsdetails
19FAIL FAIL shvar usage
detailsdetails
20FAIL FAIL shvar global
detailsdetails
21FAIL FAIL shvar local
detailsdetails
22FAIL FAIL shvar IFS
detailsdetails
23pass pass shvarGet()
38 passed, 0 OK, 0 not implemented, 0 BUG, 5 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

osh18 IFS=: myproc exports when it doesn't need to

[osh stdout] Expected ":\n 20 09 0a 0a\nIFS= z\nmyfunc IFS= x\n['', 'z', 'z', 'z']\nmyproc IFS= z\n['', 'z', 'z', 'z']\nmyproc IFS= x\n['', 'z', 'z', 'z']\n" Got ":\n 20 09 0a 0a\nIFS= z\nmyfunc IFS= x\n['', 'z', 'z', 'z']\nmyproc IFS= z\n['', 'z', 'z', 'z']\n"
[osh status] Expected 0, got 1

stdout:
:
 20 09 0a 0a
IFS= z
myfunc IFS= x
['', 'z', 'z', 'z']
myproc IFS= z
['', 'z', 'z', 'z']
stderr:
    if (len(args) === 0) {
           ^
stdlib/ysh/shvar.ysh:3: Unexpected left paren (might need a space before it)
  shvar IFS=' x' {
                 ^
[ stdin ]:30: fatal: 'shvar' appears to be external. External commands don't accept typed args (OILS-ERR-200)
osh_ALT18 IFS=: myproc exports when it doesn't need to

[osh_ALT stdout] Expected ":\n 20 09 0a 0a\nIFS= z\nmyfunc IFS= x\n['', 'z', 'z', 'z']\nmyproc IFS= z\n['', 'z', 'z', 'z']\nmyproc IFS= x\n['', 'z', 'z', 'z']\n" Got ":\n 20 09 0a 0a\nIFS= z\nmyfunc IFS= x\n['', 'z', 'z', 'z']\nmyproc IFS= z\n['', 'z', 'z', 'z']\n"
[osh_ALT status] Expected 0, got 1

stdout:
:
 20 09 0a 0a
IFS= z
myfunc IFS= x
['', 'z', 'z', 'z']
myproc IFS= z
['', 'z', 'z', 'z']
stderr:
  source --builtin ysh/shvar.ysh
                   ^~~
[ stdin ]:4: source failed: No builtin file 'stdlib/ysh/shvar.ysh'
  shvar IFS=' x' {
                 ^
[ stdin ]:30: fatal: 'shvar' appears to be external. External commands don't accept typed args (OILS-ERR-200)
osh19 shvar usage

[osh stdout] Expected 'status=2\nstatus=2\nstatus=2\n', got ''
[osh status] Expected 0, got 3

stdout:
stderr: 
  shvar
  ^~~~~
[ stdin ]:6: fatal: 'shvar' wasn't passed block param 'block'
osh_ALT19 shvar usage

[osh_ALT stdout] Expected 'status=2\nstatus=2\nstatus=2\n', got 'status=127\n'
[osh_ALT status] Expected 0, got 1

stdout:
status=127
stderr:
  source --builtin ysh/shvar.ysh
                   ^~~
[ stdin ]:4: source failed: No builtin file 'stdlib/ysh/shvar.ysh'
  shvar
  ^~~~~
[ stdin ]:6: 'shvar' not found (OILS-ERR-100)
  shvar {  # no arg
        ^
[ stdin ]:9: fatal: 'shvar' appears to be external. External commands don't accept typed args (OILS-ERR-200)
osh20 shvar global

[osh stdout] Expected '_ESCAPER=\n_DIALECT=\nblock _ESCAPER=html\nblock _DIALECT=ninja\n_ESCAPER=\n_DIALECT=\n___\n_ESCAPER=foo\n_DIALECT=bar\nblock _ESCAPER=html\nblock _DIALECT=ninja\nnested _ESCAPER=nested\nnested _DIALECT=ninja\n_ESCAPER=foo\n_DIALECT=bar\n' Got '_ESCAPER=\n_DIALECT=\nblock _ESCAPER=html\nblock _DIALECT=ninja\n_ESCAPER=\n_DIALECT=\n___\n_ESCAPER=foo\n_DIALECT=bar\nblock _ESCAPER=html\nblock _DIALECT=ninja\nnested _ESCAPER=nested\nnested _DIALECT=bar\n_ESCAPER=foo\n_DIALECT=bar\n'

stdout:
_ESCAPER=
_DIALECT=
block _ESCAPER=html
block _DIALECT=ninja
_ESCAPER=
_DIALECT=
___
_ESCAPER=foo
_DIALECT=bar
block _ESCAPER=html
block _DIALECT=ninja
nested _ESCAPER=nested
nested _DIALECT=bar
_ESCAPER=foo
_DIALECT=bar
stderr:
osh_ALT20 shvar global

[osh_ALT stdout] Expected '_ESCAPER=\n_DIALECT=\nblock _ESCAPER=html\nblock _DIALECT=ninja\n_ESCAPER=\n_DIALECT=\n___\n_ESCAPER=foo\n_DIALECT=bar\nblock _ESCAPER=html\nblock _DIALECT=ninja\nnested _ESCAPER=nested\nnested _DIALECT=ninja\n_ESCAPER=foo\n_DIALECT=bar\n' Got ''
[osh_ALT status] Expected 0, got 2

stdout:
stderr: 
  source --builtin ysh/shvar.ysh
                   ^~~
[ stdin ]:4: source failed: No builtin file 'stdlib/ysh/shvar.ysh'
  source --builtin ysh/shvar.ysh
  ^~~~~~
[ stdin ]:4: errexit PID 40535: command.Simple failed with status 2
osh21 shvar local

[osh stdout] Expected "['a', 'b', 'c']\nIFS=x\n['a b c']\nMYTEMP=foo\n['a', 'b', 'c']\nMYTEMP=undef\n" Got "['a', 'b', 'c']\nIFS=x\n['foo']\nMYTEMP=foo\n['a', 'b', 'c']\nMYTEMP=undef\n"

stdout:
['a', 'b', 'c']
IFS=x
['foo']
MYTEMP=foo
['a', 'b', 'c']
MYTEMP=undef
stderr:
osh_ALT21 shvar local

[osh_ALT stdout] Expected "['a', 'b', 'c']\nIFS=x\n['a b c']\nMYTEMP=foo\n['a', 'b', 'c']\nMYTEMP=undef\n" Got ''
[osh_ALT status] Expected 0, got 2

stdout:
stderr: 
  source --builtin ysh/shvar.ysh
                   ^~~
[ stdin ]:4: source failed: No builtin file 'stdlib/ysh/shvar.ysh'
  source --builtin ysh/shvar.ysh
  ^~~~~~
[ stdin ]:4: errexit PID 40542: command.Simple failed with status 2
osh22 shvar IFS

[osh stdout] Expected ' 20 09 0a 0a\ninside IFS=w\nmylocal=x\n 20 09 0a 0a\n' Got ' 20 09 0a 0a\ninside IFS=w\n'
[osh status] Expected 0, got 1

stdout:
 20 09 0a 0a
inside IFS=w
stderr:
      echo mylocal="$mylocal"  # I do NOT want a new scope!
                    ^~~~~~~~
[ stdin ]:11: fatal: Undefined variable 'mylocal'
osh_ALT22 shvar IFS

[osh_ALT stdout] Expected ' 20 09 0a 0a\ninside IFS=w\nmylocal=x\n 20 09 0a 0a\n' Got ''
[osh_ALT status] Expected 0, got 2

stdout:
stderr: 
  source --builtin ysh/shvar.ysh
                   ^~~
[ stdin ]:3: source failed: No builtin file 'stdlib/ysh/shvar.ysh'
  source --builtin ysh/shvar.ysh
  ^~~~~~
[ stdin ]:3: errexit PID 40548: command.Simple failed with status 2