Results for ysh-blocks.test.sh

statusoshosh-cpp
pass 1510
FAIL 16
total1616
caseoshosh-cppdescription
0pass FAIL cd accepts a block, runs it in different dir
details
1pass pass cd with block: requires explicit command
2pass pass cd passed block with return 1
3FAIL FAIL cd passed a block defined in a different scope
detailsdetails
4pass FAIL io->eval() and io.captureStdout()/io.captureAll() passed a block in different scope
details
5pass pass block doesn't have its own scope
6pass FAIL redirects allowed in words, typed args, and after block
details
7pass FAIL block literal in expression mode: ^(echo $PWD)
details
8pass FAIL block arg as typed expression
details
9pass pass Pass invalid typed args
10pass pass Pass too many typed args
11pass pass 'builtin' and 'command' with block
12pass pass Consistency: Exit Status and Blocks
13pass pass Consistency: Unwanted Blocks Are Errors
14pass pass Block with Bare Assignments
15pass pass Proc that doesn't take a block
25 passed, 0 OK, 0 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh-cpp0 cd accepts a block, runs it in different dir

[osh-cpp stdout] Expected '/\nOLDPWD=\ndone\nPWD=/tmp\npwd builtin: /tmp\n' Got '/\nOLDPWD=\ndone\n'
[osh-cpp status] Expected 0 Got 2

stdout:
/
OLDPWD=
done
stderr:
    write --sep ' ' pwd builtin: $(pwd)
                                      ^
[ stdin ]:13: Invalid word while parsing command list
osh3 cd passed a block defined in a different scope

[osh status] Expected 0 Got 1

stdout:
stderr: 
    var b = ^(echo "i = $i")
                        ^~
[ stdin ]:9: fatal: Undefined variable 'i'
osh-cpp3 cd passed a block defined in a different scope

[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
    var b = ^(echo "i = $i")
                           ^
[ stdin ]:9: Invalid word while parsing command list
osh-cpp4 io->eval() and io.captureStdout()/io.captureAll() passed a block in different scope

[osh-cpp stdout] Expected 'i = 42\ni = 42\n(Dict) {"x":"x"}\nstdout i = 42\nstdout i = 42\n\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
    var b = ^(var x = 'x'; echo "i = $i")
                                        ^
[ stdin ]:19: Invalid word while parsing command list
osh-cpp6 redirects allowed in words, typed args, and after block

[osh-cpp stdout] Expected '1 /tmp\n2 /tmp\n3 /tmp\n4 /tmp\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  cd /tmp >>out (; ; ^(echo 2 $PWD))
                                  ^
[ stdin ]:10: Invalid word while parsing command list
osh-cpp7 block literal in expression mode: ^(echo $PWD)

[osh-cpp stdout] Expected '1\none\ntwo\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  const myblock = ^(echo $PWD | wc -l)
                                     ^
[ stdin ]:3: Invalid word while parsing command list
osh-cpp8 block arg as typed expression

[osh-cpp stdout] Expected '/tmp\n/tmp\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  cd /tmp (; ; ^(echo $PWD))
                          ^
[ stdin ]:3: Invalid word while parsing command list