spec test index / oilshell.org
status | ysh | ysh_ALT | |
pass | 6 | 6 | |
FAIL | 1 | 1 | |
total | 7 | 7 | |
case | ysh | ysh_ALT | description |
0 | pass | pass | with eval builtin command, in global scope |
1 | pass | pass | with eval builtin command, in local scope |
2 | pass | pass | with eval builtin command, making them global with names() and setVar() |
3 | FAIL | FAIL | with parseCommand() then io->eval(), in local scope |
details | details | ||
4 | pass | pass | with parseCommand() then io->eval(cmd, vars={out_dict: {}}) |
5 | pass | pass | with evalToDict() |
6 | pass | pass | with runtime REFLECTION via __invoke__ - no parsing |
12 passed, 0 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped 1 failed under osh
ysh | 3 with parseCommand() then io->eval(), in local scope [ysh stdout] Expected 'prefix a\nprefix b\n', got '(value.Command\n frag: \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:...0x7f0ca466a8e8)\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:...0x7f0ca466a8e8)\n name: prefix\n )\n ]\n )\n )\n body: \n (BraceGroup\n left: (Token id:Id.Lit_LBrace length:1 col:20 line:...0x7f0ca466a8e8)\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: ...0x7f0ca437b0f0\n )\n )\n more_env: []\n words: [\n (CompoundWord parts:[...0x7f0ca4373738])\n (CompoundWord\n parts: [\n (SimpleVarSub\n tok: (Token id:Id.VSub_DollarName length:7 col:7 line:...0x7f0ca466aa48)\n )\n ]\n )\n (CompoundWord\n parts: [(Token id:Id.Lit_Chars length:1 col:15 line:...0x7f0ca466aa48)]\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:...0x7f0ca437b0f0)\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:...0x7f0ca437b280)\n ]\n)\n' stdout: (value.Command frag: (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:...0x7f0ca466a8e8) sig: (proc_sig.Closed word: (ParamGroup params: [ (Param blame_tok: (Token id:Id.Expr_Name length:6 col:12 line:...0x7f0ca466a8e8) name: prefix ) ] ) ) body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:20 line:...0x7f0ca466a8e8) 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: ...0x7f0ca437b0f0 ) ) more_env: [] words: [ (CompoundWord parts:[...0x7f0ca4373738]) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:7 col:7 line:...0x7f0ca466aa48) ) ] ) (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:15 line:...0x7f0ca466aa48)] ) ] is_last_cmd: F ) ] right: (Token id: Id.Lit_RBrace length: 1 col: 0 line: (SourceLine line_num:3 content:"}\n" src:...0x7f0ca437b0f0) ) ) ) ) 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:...0x7f0ca437b280) ] )stderr: echo_a zz ^~~~~~ [ stdin ]:15: 'echo_a' not found (OILS-ERR-100) [ stdin ]:15: errexit PID 43099: command.Simple failed with status 127 |
ysh_ALT | 3 with parseCommand() then io->eval(), in local scope [ysh_ALT stdout] Expected 'prefix a\nprefix b\n', got '(value.Command\n frag: \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:...0x7fa8aed461d8)\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:...0x7fa8aed461d8)\n name: prefix\n )\n ]\n )\n )\n body: \n (BraceGroup\n left: (Token id:Id.Lit_LBrace length:1 col:20 line:...0x7fa8aed461d8)\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: ...0x7fa8aedbda68\n )\n )\n more_env: []\n words: [\n (CompoundWord parts:[...0x7fa8aed492e8])\n (CompoundWord\n parts: [\n (SimpleVarSub\n tok: (Token id:Id.VSub_DollarName length:7 col:7 line:...0x7fa8aed46318)\n )\n ]\n )\n (CompoundWord\n parts: [(Token id:Id.Lit_Chars length:1 col:15 line:...0x7fa8aed46318)]\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:...0x7fa8aedbda68)\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:...0x7fa8aedbdbd0)\n ]\n)\n' stdout: (value.Command frag: (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:...0x7fa8aed461d8) sig: (proc_sig.Closed word: (ParamGroup params: [ (Param blame_tok: (Token id:Id.Expr_Name length:6 col:12 line:...0x7fa8aed461d8) name: prefix ) ] ) ) body: (BraceGroup left: (Token id:Id.Lit_LBrace length:1 col:20 line:...0x7fa8aed461d8) 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: ...0x7fa8aedbda68 ) ) more_env: [] words: [ (CompoundWord parts:[...0x7fa8aed492e8]) (CompoundWord parts: [ (SimpleVarSub tok: (Token id:Id.VSub_DollarName length:7 col:7 line:...0x7fa8aed46318) ) ] ) (CompoundWord parts: [(Token id:Id.Lit_Chars length:1 col:15 line:...0x7fa8aed46318)] ) ] is_last_cmd: F ) ] right: (Token id: Id.Lit_RBrace length: 1 col: 0 line: (SourceLine line_num:3 content:"}\n" src:...0x7fa8aedbda68) ) ) ) ) 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:...0x7fa8aedbdbd0) ] )stderr: echo_a zz ^~~~~~ [ stdin ]:15: 'echo_a' not found (OILS-ERR-100) [ stdin ]:15: errexit PID 43102: command.Simple failed with status 127 |