Results for hay.test.sh

statusoshosh_ALT
pass 2121
FAIL 77
total2828
caseoshosh_ALTdescription
0pass pass hay builtin usage
1pass pass hay reset
2pass pass hay eval can't be nested
3pass pass hay names at top level
4FAIL FAIL Parsing Nested Attributes nodes (bug fix)
detailsdetails
5FAIL FAIL hay eval Attr node, and JSON
detailsdetails
6FAIL FAIL hay eval shell node, and JSON
detailsdetails
7pass pass _hay() register
8pass pass haynode builtin can define nodes
9pass pass haynode: usage errors (name or block required)
10pass pass haynode: shell nodes require block args; attribute nodes don't
11pass pass hay eval with shopt -s ysh:all
12pass pass Attr block with duplicate names
13pass pass Scope of Variables Inside Hay Blocks
14pass pass Nested bare assignment
15pass pass Param with same name as Hay attribute
16pass pass hay define and then an error
17pass pass parseHay()
18pass pass Code Blocks: parseHay() then shvar _DIALECT= { evalHay() }
19pass pass evalHay() usage
20pass pass Attribute / Data Blocks (package-manager)
21FAIL FAIL Typed Args to Hay Node
detailsdetails
22FAIL FAIL OSH and hay (dynamic parsing)
detailsdetails
23FAIL FAIL CODE node provides code_str, serialized code - issue #2050
detailsdetails
24FAIL FAIL Proc within Hay node
detailsdetails
25pass pass Using Hay node from another module
26pass pass Defining Hay node in another module
27pass pass Using Hay with --eval flags
42 passed, 0 OK, 0 not implemented, 0 BUG, 7 failed, 0 timeouts, 0 cases skipped
7 failed under osh

Details on runs that didn't PASS

osh4 Parsing Nested Attributes nodes (bug fix)

[osh stdout] Expected '', got '--- -\t2025-03-27 15:52:12.372871182 +0000\n+++ actual.txt\t2025-03-27 15:52:12.368169487 +0000\n@@ -1,3 +0,0 @@\n-{\n- "path": "LICENSE.txt"\n-}\n'

stdout:
--- -	2025-03-27 15:52:12.372871182 +0000
+++ actual.txt	2025-03-27 15:52:12.368169487 +0000
@@ -1,3 +0,0 @@
-{
-  "path": "LICENSE.txt"
-}
stderr:
  json write (_hay()) | jq '.children[0].children[0].attrs' > actual.txt
                        ^~
[ stdin ]:15: Command 'jq' not found (OILS-ERR-100)
  invalid = 'syntax'  # parse error
          ^
[ stdin ]:23: Unexpected = (Hint: use var/setvar, or quote it)
osh_ALT4 Parsing Nested Attributes nodes (bug fix)

[osh_ALT stdout] Expected '', got '--- -\t2025-03-27 15:52:12.435541093 +0000\n+++ actual.txt\t2025-03-27 15:52:12.431170107 +0000\n@@ -1,3 +0,0 @@\n-{\n- "path": "LICENSE.txt"\n-}\n'

stdout:
--- -	2025-03-27 15:52:12.435541093 +0000
+++ actual.txt	2025-03-27 15:52:12.431170107 +0000
@@ -1,3 +0,0 @@
-{
-  "path": "LICENSE.txt"
-}
stderr:
  json write (_hay()) | jq '.children[0].children[0].attrs' > actual.txt
                        ^~
[ stdin ]:15: Command 'jq' not found (OILS-ERR-100)
  invalid = 'syntax'  # parse error
          ^
[ stdin ]:23: Unexpected = (Hint: use var/setvar, or quote it)
osh5 hay eval Attr node, and JSON

[osh stdout] Expected 'diff 0\n', got '--- -\t2025-03-27 15:52:12.508133837 +0000\n+++ out.txt\t2025-03-27 15:52:12.503170815 +0000\n@@ -1,29 +0,0 @@\n-{\n- "source": null,\n- "children": [\n- {\n- "type": "Package",\n- "args": [\n- "foo"\n- ],\n- "children": [],\n- "attrs": {\n- "int": 42,\n- "bool": true,\n- "mynull": null,\n- "mystr": "spam\\n",\n- "mylist": [\n- 5,\n- "foo",\n- {}\n- ]\n- }\n- },\n- {\n- "type": "User",\n- "args": [\n- "alice"\n- ]\n- }\n- ]\n-}\ndiff 1\n'

stdout:
--- -	2025-03-27 15:52:12.508133837 +0000
+++ out.txt	2025-03-27 15:52:12.503170815 +0000
@@ -1,29 +0,0 @@
-{
-  "source": null,
-  "children": [
-    {
-      "type": "Package",
-      "args": [
-        "foo"
-      ],
-      "children": [],
-      "attrs": {
-        "int": 42,
-        "bool": true,
-        "mynull": null,
-        "mystr": "spam\n",
-        "mylist": [
-          5,
-          "foo",
-          {}
-        ]
-      }
-    },
-    {
-      "type": "User",
-      "args": [
-        "alice"
-      ]
-    }
-  ]
-}
diff 1
stderr:
  json write (result) | jq . > out.txt
                        ^~
[ stdin ]:18: Command 'jq' not found (OILS-ERR-100)
osh_ALT5 hay eval Attr node, and JSON

[osh_ALT stdout] Expected 'diff 0\n', got '--- -\t2025-03-27 15:52:12.573059604 +0000\n+++ out.txt\t2025-03-27 15:52:12.568171454 +0000\n@@ -1,29 +0,0 @@\n-{\n- "source": null,\n- "children": [\n- {\n- "type": "Package",\n- "args": [\n- "foo"\n- ],\n- "children": [],\n- "attrs": {\n- "int": 42,\n- "bool": true,\n- "mynull": null,\n- "mystr": "spam\\n",\n- "mylist": [\n- 5,\n- "foo",\n- {}\n- ]\n- }\n- },\n- {\n- "type": "User",\n- "args": [\n- "alice"\n- ]\n- }\n- ]\n-}\ndiff 1\n'

stdout:
--- -	2025-03-27 15:52:12.573059604 +0000
+++ out.txt	2025-03-27 15:52:12.568171454 +0000
@@ -1,29 +0,0 @@
-{
-  "source": null,
-  "children": [
-    {
-      "type": "Package",
-      "args": [
-        "foo"
-      ],
-      "children": [],
-      "attrs": {
-        "int": 42,
-        "bool": true,
-        "mynull": null,
-        "mystr": "spam\n",
-        "mylist": [
-          5,
-          "foo",
-          {}
-        ]
-      }
-    },
-    {
-      "type": "User",
-      "args": [
-        "alice"
-      ]
-    }
-  ]
-}
diff 1
stderr:
  json write (result) | jq . > out.txt
                        ^~
[ stdin ]:18: Command 'jq' not found (OILS-ERR-100)
osh6 hay eval shell node, and JSON

[osh stdout] Expected '', got '--- -\t2025-03-27 15:52:12.644458136 +0000\n+++ out.txt\t2025-03-27 15:52:12.640172162 +0000\n@@ -1,19 +0,0 @@\n-{\n- "source": null,\n- "children": [\n- {\n- "type": "TASK",\n- "args": [],\n- "location_str": "[ stdin ]",\n- "location_start_line": 6,\n- "code_str": " echo hi "\n- },\n- {\n- "type": "TASK",\n- "args": [],\n- "location_str": "[ stdin ]",\n- "location_start_line": 8,\n- "code_str": " \\n echo one\\n echo two\\n "\n- }\n- ]\n-}\n'
[osh status] Expected 0, got 1

stdout:
--- -	2025-03-27 15:52:12.644458136 +0000
+++ out.txt	2025-03-27 15:52:12.640172162 +0000
@@ -1,19 +0,0 @@
-{
-  "source": null,
-  "children": [
-    {
-      "type": "TASK",
-      "args": [],
-      "location_str": "[ stdin ]",
-      "location_start_line": 6,
-      "code_str": "         echo hi "
-    },
-    {
-      "type": "TASK",
-      "args": [],
-      "location_str": "[ stdin ]",
-      "location_start_line": 8,
-      "code_str": "        \n    echo one\n    echo two\n  "
-    }
-  ]
-}
stderr:
  json write (result) | jq . > out.txt
                        ^~
[ stdin ]:14: Command 'jq' not found (OILS-ERR-100)
osh_ALT6 hay eval shell node, and JSON

[osh_ALT stdout] Expected '', got '--- -\t2025-03-27 15:52:12.706275771 +0000\n+++ out.txt\t2025-03-27 15:52:12.702172772 +0000\n@@ -1,19 +0,0 @@\n-{\n- "source": null,\n- "children": [\n- {\n- "type": "TASK",\n- "args": [],\n- "location_str": "[ stdin ]",\n- "location_start_line": 6,\n- "code_str": " echo hi "\n- },\n- {\n- "type": "TASK",\n- "args": [],\n- "location_str": "[ stdin ]",\n- "location_start_line": 8,\n- "code_str": " \\n echo one\\n echo two\\n "\n- }\n- ]\n-}\n'
[osh_ALT status] Expected 0, got 1

stdout:
--- -	2025-03-27 15:52:12.706275771 +0000
+++ out.txt	2025-03-27 15:52:12.702172772 +0000
@@ -1,19 +0,0 @@
-{
-  "source": null,
-  "children": [
-    {
-      "type": "TASK",
-      "args": [],
-      "location_str": "[ stdin ]",
-      "location_start_line": 6,
-      "code_str": "         echo hi "
-    },
-    {
-      "type": "TASK",
-      "args": [],
-      "location_str": "[ stdin ]",
-      "location_start_line": 8,
-      "code_str": "        \n    echo one\n    echo two\n  "
-    }
-  ]
-}
stderr:
  json write (result) | jq . > out.txt
                        ^~
[ stdin ]:14: Command 'jq' not found (OILS-ERR-100)
osh21 Typed Args to Hay Node

[osh status] Expected 0, got 3

stdout:
stderr: 
  when NAME [x > 0] {
             ^
[ stdin ]:6: fatal: Expected 0 typed args, but got 1
osh_ALT21 Typed Args to Hay Node

[osh_ALT status] Expected 0, got 3

stdout:
stderr: 
  when NAME [x > 0] {
             ^
[ stdin ]:6: fatal: Expected 0 typed args, but got 1
osh22 OSH and hay (dynamic parsing)

[osh stdout] Expected "backticks\neval\nTYPE TASK\nCODE \n echo `echo task backticks`\n eval 'echo task eval'\n ___\n" Got "backticks\neval\nTYPE TASK\nCODE \n echo `echo task backticks`\necho task backticks eval 'echo task eval'\n ___\n"

stdout:
backticks
eval
TYPE TASK
CODE         
    echo `echo task backticks`
echo task backticks    eval 'echo task eval'
  ___
stderr:
osh_ALT22 OSH and hay (dynamic parsing)

[osh_ALT stdout] Expected "backticks\neval\nTYPE TASK\nCODE \n echo `echo task backticks`\n eval 'echo task eval'\n ___\n" Got "backticks\neval\nTYPE TASK\nCODE \n echo `echo task backticks`\necho task backticks eval 'echo task eval'\n ___\n"

stdout:
backticks
eval
TYPE TASK
CODE         
    echo `echo task backticks`
echo task backticks    eval 'echo task eval'
  ___
stderr:
osh23 CODE node provides code_str, serialized code - issue #2050

[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1266, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2285, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 2084, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1811, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1108, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 744, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/vm.py", line 234, in RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 426, in _RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/vm.py", line 250, in RunBuiltin
    return self._RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/vm.py", line 260, in _RunBuiltinProc
    status = builtin_proc.Run(cmd_val)
  File "/home/uke/oil/builtin/hay_ysh.py", line 429, in Run
    unbound_frag)
  File "/home/uke/oil/osh/cmd_eval.py", line 2359, in EvalCommandFrag
    return self._Execute(frag)  # can raise FatalRuntimeError, etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 2084, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1930, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/uke/oil/osh/cmd_eval.py", line 2161, in _ExecuteList
    status = self._Execute(child)
  File "/home/uke/oil/osh/cmd_eval.py", line 2084, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1811, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1108, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 744, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/vm.py", line 234, in RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 426, in _RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/vm.py", line 250, in RunBuiltin
    return self._RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/vm.py", line 260, in _RunBuiltinProc
    status = builtin_proc.Run(cmd_val)
  File "/home/uke/oil/builtin/hay_ysh.py", line 408, in Run
    lit_block.lines)
  File "/home/uke/oil/core/alloc.py", line 68, in SnipCodeBlock
    assert found_left, "Couldn't find left token"
AssertionError: Couldn't find left token
osh_ALT23 CODE node provides code_str, serialized code - issue #2050

[osh_ALT status] Expected 0, got 1
[osh_ALT stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oil.py", line 34, in _cpython_main_hook
    sys.exit(oils_for_unix.main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1266, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2288, in ExecuteAndCatch
    raise  # 'eval break' and 'source return.sh', etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 2137, in _Execute
    errexit_loc = process_sub_st.locs[i]
  File "/home/uke/oil/osh/cmd_eval.py", line 1822, in _Dispatch
    self._LeafTick()
  File "/home/uke/oil/osh/cmd_eval.py", line 1108, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 744, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/vm.py", line 234, in RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 426, in _RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/vm.py", line 250, in RunBuiltin
    return self._RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/vm.py", line 260, in _RunBuiltinProc
    status = builtin_proc.Run(cmd_val)
  File "/home/uke/oil/builtin/hay_ysh.py", line 429, in Run
    unbound_frag)
  File "/home/uke/oil/osh/cmd_eval.py", line 2359, in EvalCommandFrag
    return self._Execute(frag)  # can raise FatalRuntimeError, etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 2137, in _Execute
    errexit_loc = process_sub_st.locs[i]
  File "/home/uke/oil/osh/cmd_eval.py", line 1930, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/uke/oil/osh/cmd_eval.py", line 2161, in _ExecuteList
    status = self._Execute(child)
  File "/home/uke/oil/osh/cmd_eval.py", line 2137, in _Execute
    errexit_loc = process_sub_st.locs[i]
  File "/home/uke/oil/osh/cmd_eval.py", line 1822, in _Dispatch
    self._LeafTick()
  File "/home/uke/oil/osh/cmd_eval.py", line 1108, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 744, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/vm.py", line 234, in RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 426, in _RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/vm.py", line 250, in RunBuiltin
    return self._RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/vm.py", line 260, in _RunBuiltinProc
    status = builtin_proc.Run(cmd_val)
  File "/home/uke/oil/builtin/hay_ysh.py", line 431, in Run
    result['attrs'] = value.Dict(bindings)
  File "/home/uke/oil/core/alloc.py", line 68, in SnipCodeBlock
    assert found_left, "Couldn't find left token"
AssertionError: Couldn't find left token
FATAL: couldn't import from app bundle '/home/uke/oil/_tmp/oil-tar-test/oil-0.28.0/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
osh24 Proc within Hay node

[osh stdout] Expected '', got "(Dict)\n{\n source: null,\n children: [\n {\n type: 'Package',\n args: ['cpython'],\n children: [],\n attrs: {version: '3.11', build: <Proc 0x7f219dee3dd0>}\n }\n ]\n}\n<Proc 0x7f219dee3dd0>\nversion=3.11\n"
[osh status] Expected 0, got 2

stdout:
(Dict)
{
    source: null,
    children: [
        {
            type: 'Package',
            args: ['cpython'],
            children: [],
            attrs: {version: '3.11', build: <Proc 0x7f219dee3dd0>}
        }
    ]
}
<Proc 0x7f219dee3dd0>
version=3.11
stderr:
make: *** No targets specified and no makefile found.  Stop.
      make
      ^~~~
[ stdin ]:10: errexit PID 2546: command.Simple failed with status 2
osh_ALT24 Proc within Hay node

[osh_ALT stdout] Expected '', got "(Dict)\n{\n source: null,\n children: [\n {\n type: 'Package',\n args: ['cpython'],\n children: [],\n attrs: {version: '3.11', build: <Proc 0x7f2d26bf6a98>}\n }\n ]\n}\n<Proc 0x7f2d26bf6a98>\nversion=3.11\n"
[osh_ALT status] Expected 0, got 2

stdout:
(Dict)
{
    source: null,
    children: [
        {
            type: 'Package',
            args: ['cpython'],
            children: [],
            attrs: {version: '3.11', build: <Proc 0x7f2d26bf6a98>}
        }
    ]
}
<Proc 0x7f2d26bf6a98>
version=3.11
stderr:
make: *** No targets specified and no makefile found.  Stop.
      make
      ^~~~
[ stdin ]:10: errexit PID 2550: command.Simple failed with status 2