Results for ysh-purity.test.sh

statusosh
pass 8
FAIL 9
total17
caseoshdescription
0pass eval() is a pure function
1pass evalExpr() is a pure function
2FAIL Idiom to handle purity errors from untrusted config files
details
3pass Executor: can run user-defined Procs
4pass Executor: can run Hay (while Hay is hard-coded)
5pass Executor: External Commands not allowed
6pass Command subs, pipelines not allowed with --eval-pure
7pass Process subs, subshells not allowed with eval()
8pass Background job &
9FAIL Are any builtins allowed? true, false
details
10FAIL Are source or use builtins allowed?
details
11FAIL Can log to stderr in pure mode
details
12FAIL io and vm are not allowed
details
13FAIL Can't make an alias of io->eval and call it, etc.
details
14FAIL Globbing not allowed
details
15FAIL $RANDOM $SECONDS
details
16FAIL Purely-evaluated code can't set traps for later
details
8 passed, 0 OK, 0 not implemented, 0 BUG, 9 failed, 0 timeouts, 0 cases skipped
9 failed under osh

Details on runs that didn't PASS

osh2 Idiom to handle purity errors from untrusted config files

[osh stdout] Expected '', got "TODO: what's the idiom?\n"

stdout:
TODO: what's the idiom?
stderr:
osh9 Are any builtins allowed? true, false

[osh status] Expected 0, got 1

stdout:
true
builtin true
command true
stderr:
    builtin false
    ^~~~~~~
[ stdin ]:13: errexit PID 43559: command.Simple failed with status 1
osh10 Are source or use builtins allowed?

[osh status] Expected 0, got 127

stdout:
stderr: 
    source foo.ysh
    ^~~~~~
[ stdin ]:5: Command 'source' not found in pure mode (OILS-ERR-102)
[ stdin ]:5: errexit PID 43562: command.Simple failed with status 127
osh11 Can log to stderr in pure mode

[osh status] Expected 0, got 127

stdout:
stderr: 
    log "hi $name"
    ^~~
[ stdin ]:7: Command 'log' not found (OILS-ERR-100)
[ stdin ]:7: errexit PID 43565: command.Simple failed with status 127
osh12 io and vm are not allowed

[osh stdout] Expected '', got '<Frame 0x7f1bef7cdf80>\n(Int) 139757958782848\n<Stdin>\n<Frame 0x7f1bef7cdf80>\n(Int) 139757958782848\n<Stdin>\n'

stdout:
<Frame 0x7f1bef7cdf80>
(Int)   139757958782848
<Stdin>
<Frame 0x7f1bef7cdf80>
(Int)   139757958782848
<Stdin>
stderr:
osh13 Can't make an alias of io->eval and call it, etc.

[osh stdout] Expected '', got 'hi\n'

stdout:
hi
stderr:
osh14 Globbing not allowed

[osh stdout] Expected '', got '*.txt\n'
[osh status] Expected 0, got 127

stdout:
*.txt
stderr:
    echo *.txt
    ^~~~
[ stdin ]:2: Command 'echo' not found in pure mode (OILS-ERR-102)
osh15 $RANDOM $SECONDS

[osh status] Expected 0, got 1

stdout:
stderr: 
    echo not-implemented=$RANDOM
                         ^~~~~~~
[ stdin ]:4: fatal: Undefined variable 'RANDOM'
osh16 Purely-evaluated code can't set traps for later

[osh status] Expected 0, got 127

stdout:
stderr: 
    trap 'echo INT' INT
    ^~~~
[ stdin ]:2: Command 'trap' not found in pure mode (OILS-ERR-102)