Results for ysh-blocks.test.sh

statusoshosh_ALT
pass 1616
FAIL 22
total1818
caseoshosh_ALTdescription
0pass pass cd accepts a block, runs it in different dir
1pass pass cd with block: requires explicit command
2pass pass cd with block: fatal error in block
3pass pass cd with block: return in block
4pass pass cd with block: break in block
5pass pass cd with block exits with status 0
6pass pass block doesn't have its own scope
7pass pass redirects allowed in words, typed args, and after block
8pass pass block literal in expression mode: ^(echo $PWD)
9pass pass block arg as typed expression
10pass pass Pass invalid typed args
11pass pass Pass too many typed args
12pass pass 'builtin' and 'command' with block
13FAIL FAIL Consistency: Control Flow and Blocks
detailsdetails
14FAIL FAIL Consistency: Exit Status and Blocks
detailsdetails
15pass pass Consistency: Unwanted Blocks Are Errors
16pass pass Block with Bare Assignments
17pass pass Proc that doesn't take a block
32 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

osh13 Consistency: Control Flow and Blocks

[osh stdout] Expected 'cd\ncd no loop 0\ncd\ncd loop 1\nshopt\nshopt continue 1\nshvar\nshvar continue 1\ntry\ntry break 1\n' Got 'cd\ncd no loop 0\ncd\ncd loop 1\nshopt\nshopt continue 1\nshvar continue 1\ntry\ntry break 1\n'

stdout:
cd
cd no loop 0
cd
cd loop 1
shopt
shopt continue 1
shvar continue 1
try
try break 1
stderr:
      break
      ^~~~~
[ eval word at line 3 of [ stdin ] ]:4

  eval '
  ^~~~
[ stdin ]:3: warning: Invalid control flow at top level
      break
      ^~~~~
[ eval word at line 11 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:11: fatal: Unexpected control flow in block
      continue
      ^~~~~~~~
[ eval word at line 21 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:21: fatal: Unexpected control flow in block
  proc shvar (...args;;; block) {
  ^~~~
stdlib/ysh/shvar.ysh:1: proc is a YSH keyword, but this is OSH.
    shvar FOO=foo {
                  ^
[ eval word at line 31 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:31: fatal: 'shvar' appears to be external. External commands don't accept typed args (OILS-ERR-200)
      break
      ^~~~~
[ eval word at line 44 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:44: fatal: Unexpected control flow in block
osh_ALT13 Consistency: Control Flow and Blocks

[osh_ALT stdout] Expected 'cd\ncd no loop 0\ncd\ncd loop 1\nshopt\nshopt continue 1\nshvar\nshvar continue 1\ntry\ntry break 1\n' Got 'cd\ncd no loop 0\ncd\ncd loop 1\nshopt\nshopt continue 1\nshvar continue 1\ntry\ntry break 1\n'

stdout:
cd
cd no loop 0
cd
cd loop 1
shopt
shopt continue 1
shvar continue 1
try
try break 1
stderr:
      break
      ^~~~~
[ eval word at line 3 of [ stdin ] ]:4

  eval '
  ^~~~
[ stdin ]:3: warning: Invalid control flow at top level
      break
      ^~~~~
[ eval word at line 11 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:11: fatal: Unexpected control flow in block
      continue
      ^~~~~~~~
[ eval word at line 21 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:21: fatal: Unexpected control flow in block
  source --builtin ysh/shvar.ysh
                   ^~~
[ eval word at line 31 of [ stdin ] ]:2

  eval '
  ^~~~
[ stdin ]:31: source failed: No builtin file 'stdlib/ysh/shvar.ysh'
    shvar FOO=foo {
                  ^
[ eval word at line 31 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:31: fatal: 'shvar' appears to be external. External commands don't accept typed args (OILS-ERR-200)
      break
      ^~~~~
[ eval word at line 44 of [ stdin ] ]:5

  eval '
  ^~~~
[ stdin ]:44: fatal: Unexpected control flow in block
osh14 Consistency: Exit Status and Blocks

[osh stdout] Expected 'cd=0\nshopt=0\n FOO=foo\nshvar=0\ntry=0\n', got 'cd=0\nshopt=0\n'
[osh status] Expected 0, got 1

stdout:
cd=0
shopt=0
stderr:
  proc shvar (...args;;; block) {
  ^~~~
stdlib/ysh/shvar.ysh:1: proc is a YSH keyword, but this is OSH.
  shvar FOO=foo {
                ^
[ stdin ]:15: fatal: 'shvar' appears to be external. External commands don't accept typed args (OILS-ERR-200)
osh_ALT14 Consistency: Exit Status and Blocks

[osh_ALT stdout] Expected 'cd=0\nshopt=0\n FOO=foo\nshvar=0\ntry=0\n', got 'cd=0\nshopt=0\n'
[osh_ALT status] Expected 0, got 1

stdout:
cd=0
shopt=0
stderr:
  source --builtin ysh/shvar.ysh
                   ^~~
[ stdin ]:3: source failed: No builtin file 'stdlib/ysh/shvar.ysh'
  shvar FOO=foo {
                ^
[ stdin ]:15: fatal: 'shvar' appears to be external. External commands don't accept typed args (OILS-ERR-200)