Results for hay.test.sh

statusoshosh_ALT
pass 1414
FAIL 1010
total2424
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
8FAIL FAIL haynode builtin can define nodes
detailsdetails
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
13FAIL FAIL Scope of Variables Inside Hay Blocks
detailsdetails
14FAIL FAIL Nested bare assignment
detailsdetails
15pass pass hay define and then an error
16pass pass parseHay()
17pass pass Code Blocks: parseHay() then shvar _DIALECT= { evalHay() }
18pass pass evalHay() usage
19pass pass Attribute / Data Blocks (package-manager)
20FAIL FAIL Typed Args to Hay Node
detailsdetails
21FAIL FAIL OSH and hay (dynamic parsing)
detailsdetails
22FAIL FAIL CODE node provides code_str, serialized code - issue #2050
detailsdetails
23FAIL FAIL Proc within Hay node
detailsdetails
28 passed, 0 OK, 0 not implemented, 0 BUG, 10 failed, 0 timeouts, 0 cases skipped
10 failed under osh

Details on runs that didn't PASS

osh4 Parsing Nested Attributes nodes (bug fix)

[osh stdout] Expected '', got '--- -\t2025-02-24 00:47:17.608297798 +0000\n+++ actual.txt\t2025-02-24 00:47:17.602001748 +0000\n@@ -1,3 +0,0 @@\n-{\n- "path": "LICENSE.txt"\n-}\n'

stdout:
--- -	2025-02-24 00:47:17.608297798 +0000
+++ actual.txt	2025-02-24 00:47:17.602001748 +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-02-24 00:47:17.669777244 +0000\n+++ actual.txt\t2025-02-24 00:47:17.662001942 +0000\n@@ -1,3 +0,0 @@\n-{\n- "path": "LICENSE.txt"\n-}\n'

stdout:
--- -	2025-02-24 00:47:17.669777244 +0000
+++ actual.txt	2025-02-24 00:47:17.662001942 +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-02-24 00:47:17.743667921 +0000\n+++ out.txt\t2025-02-24 00:47:17.734002175 +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-02-24 00:47:17.743667921 +0000
+++ out.txt	2025-02-24 00:47:17.734002175 +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-02-24 00:47:17.808098835 +0000\n+++ out.txt\t2025-02-24 00:47:17.798002381 +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-02-24 00:47:17.808098835 +0000
+++ out.txt	2025-02-24 00:47:17.798002381 +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-02-24 00:47:17.880450580 +0000\n+++ out.txt\t2025-02-24 00:47:17.874002627 +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-02-24 00:47:17.880450580 +0000
+++ out.txt	2025-02-24 00:47:17.874002627 +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-02-24 00:47:17.943410830 +0000\n+++ out.txt\t2025-02-24 00:47:17.934002822 +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-02-24 00:47:17.943410830 +0000
+++ out.txt	2025-02-24 00:47:17.934002822 +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)
osh8 haynode builtin can define nodes

[osh stdout] Expected 'level 0 children\n1\nlevel 1 children\n2\nlevel 0 children\n2\n' Got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
        const age = '10'
              ^~~
[ stdin ]:10: fatal: Can't assign to readonly value 'age'
osh_ALT8 haynode builtin can define nodes

[osh_ALT stdout] Expected 'level 0 children\n1\nlevel 1 children\n2\nlevel 0 children\n2\n' Got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
        const age = '10'
              ^~~
[ stdin ]:10: fatal: Can't assign to readonly value 'age'
osh13 Scope of Variables Inside Hay Blocks

[osh stdout] Expected 'location = https://example.com/downloads/foo.tar.gz\nbackup = https://archive.example.com/downloads/foo.tar.gz\ndeps location https://example.com/downloads/spam.tar.gz\ndeps backup https://archive.example.com/downloads/spam.tar.xz\nAFTER downloads/foo.tar.gz\n' Got 'location = https://example.com/downloads/foo.tar.gz\nbackup = https://archive.example.com/downloads/foo.tar.gz\n'
[osh status] Expected 0, got 1

stdout:
location = https://example.com/downloads/foo.tar.gz
backup = https://archive.example.com/downloads/foo.tar.gz
stderr:
      const URL_PATH = 'downloads/spam.tar.gz'
            ^~~~~~~~
[ stdin ]:16: fatal: Can't assign to readonly value 'URL_PATH'
osh_ALT13 Scope of Variables Inside Hay Blocks

[osh_ALT stdout] Expected 'location = https://example.com/downloads/foo.tar.gz\nbackup = https://archive.example.com/downloads/foo.tar.gz\ndeps location https://example.com/downloads/spam.tar.gz\ndeps backup https://archive.example.com/downloads/spam.tar.xz\nAFTER downloads/foo.tar.gz\n' Got 'location = https://example.com/downloads/foo.tar.gz\nbackup = https://archive.example.com/downloads/foo.tar.gz\n'
[osh_ALT status] Expected 0, got 1

stdout:
location = https://example.com/downloads/foo.tar.gz
backup = https://archive.example.com/downloads/foo.tar.gz
stderr:
      const URL_PATH = 'downloads/spam.tar.gz'
            ^~~~~~~~
[ stdin ]:16: fatal: Can't assign to readonly value 'URL_PATH'
osh14 Nested bare assignment

[osh status] Expected 0, got 1

stdout:
stderr: 
      x = 20
      ^
[ stdin ]:8: fatal: Can't assign to readonly value 'x'
osh_ALT14 Nested bare assignment

[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
      x = 20
      ^
[ stdin ]:8: fatal: Can't assign to readonly value 'x'
osh20 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_ALT20 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
osh21 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_ALT21 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:
osh22 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 1213, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2107, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1906, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1633, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 914, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 575, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 432, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 313, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 323, 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 2181, in EvalCommandFrag
    return self._Execute(frag)  # can raise FatalRuntimeError, etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 1906, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1752, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/uke/oil/osh/cmd_eval.py", line 1983, in _ExecuteList
    status = self._Execute(child)
  File "/home/uke/oil/osh/cmd_eval.py", line 1906, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1633, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 914, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 575, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 432, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 313, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 323, 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 67, in SnipCodeBlock
    assert found_left, "Couldn't find left token"
AssertionError: Couldn't find left token
osh_ALT22 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 1213, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 386, in Batch
    return status
  File "/home/uke/oil/osh/cmd_eval.py", line 2110, in ExecuteAndCatch
    raise  # 'eval break' and 'source return.sh', etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 1906, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1847, in _Dispatch
    status = self._DoTimeBlock(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 914, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 575, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 432, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 313, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 323, 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 2181, in EvalCommandFrag
    return self._Execute(frag)  # can raise FatalRuntimeError, etc.
  File "/home/uke/oil/osh/cmd_eval.py", line 1906, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1847, in _Dispatch
    status = self._DoTimeBlock(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1983, in _ExecuteList
    status = self._Execute(child)
  File "/home/uke/oil/osh/cmd_eval.py", line 1906, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1847, in _Dispatch
    status = self._DoTimeBlock(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 914, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 575, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 432, in RunSimpleCommand
    return self.RunBuiltin(builtin_i.haynode, cmd_val)
  File "/home/uke/oil/core/executor.py", line 313, in RunBuiltin
    return self.RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/executor.py", line 323, 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 67, 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
osh23 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 0x7f95e6e16320>}\n }\n ]\n}\n<Proc 0x7f95e6e16320>\n"
[osh status] Expected 0, got 1

stdout:
(Dict)
{
    source: null,
    children: [
        {
            type: 'Package',
            args: ['cpython'],
            children: [],
            attrs: {version: '3.11', build: <Proc 0x7f95e6e16320>}
        }
    ]
}
<Proc 0x7f95e6e16320>
stderr:
      echo "version=$version"
                    ^~~~~~~~
[ stdin ]:9: fatal: Undefined variable 'version'
osh_ALT23 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 0x7f464d352748>}\n }\n ]\n}\n<Proc 0x7f464d352748>\n"
[osh_ALT status] Expected 0, got 1

stdout:
(Dict)
{
    source: null,
    children: [
        {
            type: 'Package',
            args: ['cpython'],
            children: [],
            attrs: {version: '3.11', build: <Proc 0x7f464d352748>}
        }
    ]
}
<Proc 0x7f464d352748>
stderr:
      echo "version=$version"
                    ^~~~~~~~
[ stdin ]:9: fatal: Undefined variable 'version'