Results for hay.test.sh

statusoshosh_ALT
pass 2020
FAIL 88
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
27FAIL FAIL Using Hay with --eval flags
detailsdetails
40 passed, 0 OK, 0 not implemented, 0 BUG, 8 failed, 0 timeouts, 0 cases skipped
8 failed under osh

Details on runs that didn't PASS

osh4 Parsing Nested Attributes nodes (bug fix)

[osh stdout] Expected '', got '--- -\t2025-03-09 03:24:54.482320920 +0000\n+++ actual.txt\t2025-03-09 03:24:54.477752639 +0000\n@@ -1,3 +0,0 @@\n-{\n- "path": "LICENSE.txt"\n-}\n'

stdout:
--- -	2025-03-09 03:24:54.482320920 +0000
+++ actual.txt	2025-03-09 03:24:54.477752639 +0000
@@ -1,3 +0,0 @@
-{
-  "path": "LICENSE.txt"
-}
stderr:
  json write (_hay()) | jq '.children[0].children[0].attrs' > actual.txt
                        ^~
[ stdin ]:15: '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-09 03:24:54.543953008 +0000\n+++ actual.txt\t2025-03-09 03:24:54.538752328 +0000\n@@ -1,3 +0,0 @@\n-{\n- "path": "LICENSE.txt"\n-}\n'

stdout:
--- -	2025-03-09 03:24:54.543953008 +0000
+++ actual.txt	2025-03-09 03:24:54.538752328 +0000
@@ -1,3 +0,0 @@
-{
-  "path": "LICENSE.txt"
-}
stderr:
  json write (_hay()) | jq '.children[0].children[0].attrs' > actual.txt
                        ^~
[ stdin ]:15: '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-09 03:24:54.614509512 +0000\n+++ out.txt\t2025-03-09 03:24:54.608751972 +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-09 03:24:54.614509512 +0000
+++ out.txt	2025-03-09 03:24:54.608751972 +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: 'jq' not found (OILS-ERR-100)
osh_ALT5 hay eval Attr node, and JSON

[osh_ALT stdout] Expected 'diff 0\n', got '--- -\t2025-03-09 03:24:54.678003126 +0000\n+++ out.txt\t2025-03-09 03:24:54.671751651 +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-09 03:24:54.678003126 +0000
+++ out.txt	2025-03-09 03:24:54.671751651 +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: 'jq' not found (OILS-ERR-100)
osh6 hay eval shell node, and JSON

[osh stdout] Expected '', got '--- -\t2025-03-09 03:24:54.749899133 +0000\n+++ out.txt\t2025-03-09 03:24:54.744751280 +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-09 03:24:54.749899133 +0000
+++ out.txt	2025-03-09 03:24:54.744751280 +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: 'jq' not found (OILS-ERR-100)
osh_ALT6 hay eval shell node, and JSON

[osh_ALT stdout] Expected '', got '--- -\t2025-03-09 03:24:54.810827889 +0000\n+++ out.txt\t2025-03-09 03:24:54.805750970 +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-09 03:24:54.810827889 +0000
+++ out.txt	2025-03-09 03:24:54.805750970 +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: '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 1243, 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 2175, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1701, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 959, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 594, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 453, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 334, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 344, 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 2249, in EvalCommandFrag
    return self._Execute(frag)  # can raise FatalRuntimeError, etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1820, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/uke/oil/osh/cmd_eval.py", line 2051, in _ExecuteList
    status = self._Execute(child)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1701, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 959, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 594, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 453, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 334, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 344, 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 1243, 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 2178, in ExecuteAndCatch
    raise  # 'eval break' and 'source return.sh', etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1915, in _Dispatch
    status = self._DoTimeBlock(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 959, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 594, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 453, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 334, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 344, 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 2249, in EvalCommandFrag
    return self._Execute(frag)  # can raise FatalRuntimeError, etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1820, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/uke/oil/osh/cmd_eval.py", line 2051, in _ExecuteList
    status = self._Execute(child)
  File "/home/uke/oil/osh/cmd_eval.py", line 1974, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1915, in _Dispatch
    status = self._DoTimeBlock(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 959, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 594, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 453, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 334, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 344, 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.27.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 0x7feba293e050>}\n }\n ]\n}\n<Proc 0x7feba293e050>\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 0x7feba293e050>}
        }
    ]
}
<Proc 0x7feba293e050>
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 0x7f739ea2bb10>}\n }\n ]\n}\n<Proc 0x7f739ea2bb10>\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 0x7f739ea2bb10>}
        }
    ]
}
<Proc 0x7f739ea2bb10>
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
osh27 Using Hay with --eval flags

[osh stdout] Expected '{\n "type": "Package",\n "args": [\n "cpython"\n ],\n "children": [],\n "attrs": {\n "version": "3.12",\n "url": "https://python.org/release/3.12/",\n "build": null\n }\n}\nversion = 3.12, url = https://python.org/release/3.12/\n' Got ''
[osh status] Expected 0, got 3

stdout:
stderr: 
RunSimpleCommand
RunSimpleCommand
  json write (_hay().children[0], type_errors=false)
                             ^
stage-1.ysh:1: fatal: List index out of range: 0
RunSimpleCommand
RunSimpleCommand
  var pkg = _hay().children[0]
                           ^
stage-2.ysh:2: fatal: List index out of range: 0
  ... $[ENV.SH] -o ysh:all
      ^~
[ stdin ]:35: errexit PID 2560: command.Simple failed with status 3
osh_ALT27 Using Hay with --eval flags

[osh_ALT stdout] Expected '{\n "type": "Package",\n "args": [\n "cpython"\n ],\n "children": [],\n "attrs": {\n "version": "3.12",\n "url": "https://python.org/release/3.12/",\n "build": null\n }\n}\nversion = 3.12, url = https://python.org/release/3.12/\n' Got ''
[osh_ALT status] Expected 0, got 3

stdout:
stderr: 
RunSimpleCommand
RunSimpleCommand
  json write (_hay().children[0], type_errors=false)
                             ^
stage-1.ysh:1: fatal: List index out of range: 0
RunSimpleCommand
RunSimpleCommand
  var pkg = _hay().children[0]
                           ^
stage-2.ysh:2: fatal: List index out of range: 0
  ... $[ENV.SH] -o ysh:all
      ^~
[ stdin ]:35: errexit PID 2569: command.Simple failed with status 3