Results for ysh-scope.test.sh

statusosh
pass 24
FAIL 2
total26
caseoshdescription
0pass GetValue scope and shopt --unset dynamic_scope
1pass SetValue scope and shopt --unset dynamic_scope
2pass read scope
3pass printf -v x respects dynamic_scope
4pass printf -v a[i] respects dynamic_scope
5pass ${undef=a} and shopt --unset dynamic_scope
6pass declare -p respects it
7pass OshLanguageSetValue constructs
8pass shell assignments 'neutered' inside 'proc'
9pass setglobal still allows setting globals
10pass setglobal d[key] inside proc should mutate global (bug #1841)
11pass setglobal a[i] inside proc
12pass setglobal a[i] += and d.key +=
13pass setglobal a[i] - i can be local or global
14pass unset inside proc - closures and dynamic scope
15pass unset composes when you turn on dynamic scope
16pass Temp Bindings
17pass cd blocks don't introduce new scopes
18pass shvar IFS=x { myproc } rather than IFS=x myproc - no dynamic scope
19pass shvar builtin syntax
20pass shvar and shvarGet() obey dynamic scope
21pass shvar global
22pass shvar local
23pass shvar IFS
24FAIL Compare shell func vs. proc, $IFS vs. shvarGet('IFS')
details
25FAIL func and proc are like var, with respect to closures
details
24 passed, 0 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh24 Compare shell func vs. proc, $IFS vs. shvarGet('IFS')

[osh stdout] Expected "shellfunc\nIFS=z\nshvarGet IFS=z\n['x', 'x ', 'x']\n\nmyproc -> p2\nIFS=x\nshvarGet IFS=x\n['', 'z', ' z', 'z']\n\nnull\n" Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
    echo shvarGet IFS=$[shvarGet('IFS')]
                                ^
[ stdin ]:8: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh25 func and proc are like var, with respect to closures

[osh stdout] Expected 'inner inner\nouter outer\n\ninner inner\nouter outer\n\ninner\nouter\n' Got 'inner inner\nouter outer\n\ninner inner\nouter inner\n\ninner\nouter\n'

stdout:
inner inner
outer outer

inner inner
outer inner

inner
outer
stderr: