Results for ysh-blocks.test.sh

statusoshosh-cpp
pass 129
FAIL 47
total1616
caseoshosh-cppdescription
0pass FAIL cd with block
details
1pass pass cd with block: fatal error in block
2pass pass cd with block: return in block
3pass pass cd with block: break in block
4pass pass cd with block exits with status 0
5pass FAIL block doesn't have its own scope
details
6FAIL FAIL block literal in expression mode: ^(echo $PWD)
detailsdetails
7FAIL FAIL block arg as typed expression
detailsdetails
8pass pass Pass invalid typed args
9pass pass 'builtin' and 'command' with block
10pass pass Consistency: Control Flow and Blocks
11pass pass Consistency: Exit Status and Blocks
12pass FAIL Consistency: Unwanted Blocks Are Errors
details
13pass pass Block with Bare Assignments
14FAIL FAIL Block param binding
detailsdetails
15FAIL FAIL Proc that doesn't take a block
detailsdetails
21 passed, 0 OK, 0 not implemented, 0 BUG, 11 failed, 0 timeouts, 0 cases skipped
4 failed under osh

Details on runs that didn't PASS

osh-cpp0 cd with block

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

stdout:
/
OLDPWD=
done
stderr:
  if ! test "$saved" = $PWD; then
             ^~~~~~
[ stdin ]:7: fatal: Undefined variable 'saved'
osh-cpp5 block doesn't have its own scope

[osh-cpp stdout] Expected 'x=1\nx=42\nx=42\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo "x=$x"
          ^~
[ stdin ]:3: fatal: Undefined variable 'x'
osh6 block literal in expression mode: ^(echo $PWD)

[osh stdout] Expected 'one\ntwo\n', got "(Str) 'TODO: value.Block'\n(Str) 'TODO: value.Block'\n"

stdout:
(Str)   'TODO: value.Block'
(Str)   'TODO: value.Block'
stderr:
osh-cpp6 block literal in expression mode: ^(echo $PWD)

[osh-cpp stdout] Expected 'one\ntwo\n', got ''

stdout:
stderr: 
osh7 block arg as typed expression

[osh stdout] Expected '/tmp\n/tmp\n', got '/tmp\n'
[osh status] Expected 0, got 2

stdout:
/tmp
stderr:
  cd /tmp (myblock)
          ^
[ stdin ]:6: 'cd' Expected block argument
  cd /tmp (myblock)
  ^~
[ stdin ]:6: errexit PID 22891: command.Simple failed with status 2
osh-cpp7 block arg as typed expression

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

stdout:
/tmp
stderr:
  cd /tmp (myblock)
          ^
[ stdin ]:6: 'cd' Expected block argument
  cd /tmp (myblock)
  ^~
[ stdin ]:6: errexit PID 22956: command.Simple failed with status 2
osh-cpp12 Consistency: Unwanted Blocks Are Errors

[osh-cpp stdout] Expected 'true 2\nfalse 2\necho block 2\necho args 2\ncommand echo 2\nbuiltin echo 2\npushd 2\n' Got 'true 2\nfalse 2\n\necho block 0\n\necho args 0\ncommand block\ncommand echo 0\nbuiltin block\nbuiltin echo 0\n/home/andy/git/oilshell/oil/_tmp/spec-tmp/ysh-blocks.test.sh/12-osh-cpp /home/andy/git/oilshell/oil/_tmp/spec-tmp/ysh-blocks.test.sh/12-osh-cpp\npushd 0\n'

stdout:
true 2
false 2

echo block 0

echo args 0
command block
command echo 0
builtin block
builtin echo 0
/home/andy/git/oilshell/oil/_tmp/spec-tmp/ysh-blocks.test.sh/12-osh-cpp /home/andy/git/oilshell/oil/_tmp/spec-tmp/ysh-blocks.test.sh/12-osh-cpp
pushd 0
stderr:
  true { echo BAD }
       ^
[ stdin ]:3: 'true' got unexpected typed args
  false ( 42, 43 )
        ^
[ stdin ]:6: 'false' got unexpected typed args
osh14 Block param binding

[osh status] Expected 0, got 1

stdout:
stderr: 
  package unzip {
  ^~~~~~~
[ stdin ]:18: fatal: No value provided for param 'b'
osh-cpp14 Block param binding

[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  proc package(name, b Block) {
                       ^~~~~
[ stdin ]:3: proc param types should be Ref, Expr, or Block
osh15 Proc that doesn't take a block

[osh stdout] Expected 'status=1\n', got 'task name=foo\nstatus=0\n'

stdout:
task name=foo
status=0
stderr:
osh-cpp15 Proc that doesn't take a block

[osh-cpp stdout] Expected 'status=1\n', got 'task name=foo\nstatus=0\n'

stdout:
task name=foo
status=0
stderr: