Results for ysh-proc-meta.test.sh

statusysh
pass 6
FAIL 1
total7
caseyshdescription
0pass with eval builtin command, in global scope
1pass with eval builtin command, in local scope
2pass with eval builtin command, making them global with names() and setVar()
3FAIL with parseCommand() then io->eval(), in local scope
details
4pass with parseCommand() then io->eval(cmd, vars={out_dict: {}})
5pass with evalToDict()
6pass with runtime REFLECTION via __invoke__ - no parsing
6 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

ysh3 with parseCommand() then io->eval(), in local scope

[ysh stdout] Expected 'prefix a\nprefix b\n', got '(value.Block\n block: \n (cmd_frag.Expr\n c: \n (Proc\n keyword: \n (Token\n id: Id.KW_Proc\n length: 4\n col: 0\n line: \n (SourceLine\n line_num: 1\n content: "proc echo_a(prefix) {\\n"\n src: \n (source.Dynamic\n what: "parseCommand()"\n location: \n (Token\n id: Id.Op_LParen\n length: 1\n col: 26\n line: \n (SourceLine\n line_num: 9\n content: " var cmd = parseCommand(s)\\n"\n src: (source.Stdin comment:"")\n )\n )\n )\n )\n )\n name: (Token id:Id.Lit_Chars length:6 col:5 line:...0x7fb2e67114c8)\n sig: \n (proc_sig.Closed\n word: \n (ParamGroup\n params: [\n (Param\n blame_tok: (Token id:Id.Expr_Name length:6 col:12 line:...0x7fb2e67114c8)\n name: prefix\n )\n ]\n )\n )\n body: \n (BraceGroup\n left: (Token id:Id.Lit_LBrace length:1 col:20 line:...0x7fb2e67114c8)\n children: [\n (command.Simple\n blame_tok: \n (Token\n id: Id.Lit_Chars\n length: 4\n col: 2\n line: \n (SourceLine\n line_num: 2\n content: " echo $prefix a\\n"\n src: ...0x7fb2e67177d0\n )\n )\n more_env: []\n words: [\n (CompoundWord parts:[...0x7fb2e67167a0])\n (CompoundWord\n parts: [\n (SimpleVarSub\n tok: (Token id:Id.VSub_DollarName length:7 col:7 line:...0x7fb2e6711628)\n )\n ]\n )\n (CompoundWord\n parts: [(Token id:Id.Lit_Chars length:1 col:15 line:...0x7fb2e6711628)]\n )\n ]\n is_last_cmd: F\n )\n ]\n right: \n (Token\n id: Id.Lit_RBrace\n length: 1\n col: 0\n line: (SourceLine line_num:3 content:"}\\n" src:...0x7fb2e67177d0)\n )\n )\n )\n )\n captured_frame: [\n Dict\n ARGV\n (Cell exported:F readonly:F nameref:F val:(value.List items:[]))\n result\n (Cell exported:F readonly:F nameref:F val:(value.Dict d:[Dict]))\n param\n (Cell exported:F readonly:F nameref:F val:(value.Str s:a))\n s\n (Cell\n exported: F\n readonly: F\n nameref: F\n val: (value.Str s:"proc echo_a(prefix) {\\n echo $prefix a\\n}\\n")\n )\n cmd\n (Cell exported:F readonly:F nameref:F val:...0x7fb2e6717960)\n ]\n)\n'

stdout:
(value.Block
  block: 
    (cmd_frag.Expr
      c: 
        (Proc
          keyword: 
            (Token
              id: Id.KW_Proc
              length: 4
              col: 0
              line: 
                (SourceLine
                  line_num: 1
                  content: "proc echo_a(prefix) {\n"
                  src: 
                    (source.Dynamic
                      what: "parseCommand()"
                      location: 
                        (Token
                          id: Id.Op_LParen
                          length: 1
                          col: 26
                          line: 
                            (SourceLine
                              line_num: 9
                              content: "    var cmd = parseCommand(s)\n"
                              src: (source.Stdin comment:"")
                            )
                        )
                    )
                )
            )
          name: (Token id:Id.Lit_Chars length:6 col:5 line:...0x7fb2e67114c8)
          sig: 
            (proc_sig.Closed
              word: 
                (ParamGroup
                  params: [
                    (Param
                      blame_tok: (Token id:Id.Expr_Name length:6 col:12 line:...0x7fb2e67114c8)
                      name: prefix
                    )
                  ]
                )
            )
          body: 
            (BraceGroup
              left: (Token id:Id.Lit_LBrace length:1 col:20 line:...0x7fb2e67114c8)
              children: [
                (command.Simple
                  blame_tok: 
                    (Token
                      id: Id.Lit_Chars
                      length: 4
                      col: 2
                      line: 
                        (SourceLine
                          line_num: 2
                          content: "  echo $prefix a\n"
                          src: ...0x7fb2e67177d0
                        )
                    )
                  more_env: []
                  words: [
                    (CompoundWord parts:[...0x7fb2e67167a0])
                    (CompoundWord
                      parts: [
                        (SimpleVarSub
                          tok: (Token id:Id.VSub_DollarName length:7 col:7 line:...0x7fb2e6711628)
                        )
                      ]
                    )
                    (CompoundWord
                      parts: [(Token id:Id.Lit_Chars length:1 col:15 line:...0x7fb2e6711628)]
                    )
                  ]
                  is_last_cmd: F
                )
              ]
              right: 
                (Token
                  id: Id.Lit_RBrace
                  length: 1
                  col: 0
                  line: (SourceLine line_num:3 content:"}\n" src:...0x7fb2e67177d0)
                )
            )
        )
    )
  captured_frame: [
    Dict
    ARGV
    (Cell exported:F readonly:F nameref:F val:(value.List items:[]))
    result
    (Cell exported:F readonly:F nameref:F val:(value.Dict d:[Dict]))
    param
    (Cell exported:F readonly:F nameref:F val:(value.Str s:a))
    s
    (Cell
      exported: F
      readonly: F
      nameref: F
      val: (value.Str s:"proc echo_a(prefix) {\n  echo $prefix a\n}\n")
    )
    cmd
    (Cell exported:F readonly:F nameref:F val:...0x7fb2e6717960)
  ]
)
stderr:
      echo_a zz
      ^~~~~~
[ stdin ]:15: 'echo_a' not found (OILS-ERR-100)
[ stdin ]:15: errexit PID 39567: command.Simple failed with status 127