Results for here-doc.test.sh

casedashbashmkshoshdescription
0pass pass pass pass Here redirect with explicit descriptor
1pass pass pass FAIL Here doc from another input file descriptor
details
2pass pass pass FAIL Multiple here docs with different descriptors
details
3pass pass pass FAIL Multiple here docs in pipeline
details
4pass pass pass FAIL Multiple here docs in pipeline on multiple lines
details
5pass pass pass FAIL Here doc with bad var delimiter
details
6pass BUG ok FAIL Here doc with bad comsub delimiter
detailsdetailsdetails
7pass pass pass FAIL Here doc and < redirect -- last one wins
details
8pass pass pass pass < redirect and here doc -- last one wins
9pass pass pass pass Here doc with var sub, command sub, arith sub
10pass pass pass FAIL Here doc in middle. And redirects in the middle.
details
11pass pass pass pass Here doc line continuation
12pass pass pass pass Here doc with quote expansion in terminator
13pass pass pass pass Here doc with multiline double quoted string
14pass pass pass pass Two here docs -- first is ignored; second ones wins!
15pass pass ok pass Here doc with line continuation, then pipe. Syntax error.
details
16pass pass pass pass Here doc with pipe on first line
17pass pass pass pass Here doc with pipe continued on last line
18pass pass pass FAIL Here doc with builtin 'read'
details
19pass pass pass FAIL Compound command here doc
details
20pass pass pass pass Here doc in while condition and here doc in body
21pass pass pass pass Here doc in while condition and here doc in body on multiple lines
22pass pass pass pass Here doc in while loop split up more
23pass pass pass pass Mixing << and <<-
24pass pass pass FAIL Two compound commands with two here docs
details
25pass pass pass FAIL Function def and execution with here doc
details
26pass pass pass pass Here doc as command prefix
27pass pass pass pass Redirect after here doc
28pass pass pass pass here doc stripping tabs
29N-I pass pass pass Here doc within subshell with boolean
details

104 passed, 2 ok, 1 known unimplemented, 1 known bugs, 12 failed, 0 skipped

Details on runs that didn't PASS

osh1 Here doc from another input file descriptor

[osh stdout] Expected b'5: fd5\n', got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "tests/read_from_fd.py", line 20, in <module>
    main(sys.argv)
  File "tests/read_from_fd.py", line 15, in main
    in_str = os.read(fd, 1024)
OSError: [Errno 9] Bad file descriptor
osh2 Multiple here docs with different descriptors

[osh stdout] Expected b'0: fd0\n3: fd3\n', got b'0: fd3\n'

stdout:
0: fd3
stderr:
Traceback (most recent call last):
  File "tests/read_from_fd.py", line 20, in <module>
    main(sys.argv)
  File "tests/read_from_fd.py", line 15, in main
    in_str = os.read(fd, 1024)
OSError: [Errno 9] Bad file descriptor
osh3 Multiple here docs in pipeline

[osh stdout] Expected b'0: 3: fd3\n5: fd5\n', got b'0: '

stdout:
0: 
stderr:
Traceback (most recent call last):
  File "tests/read_from_fd.py", line 20, in <module>
    main(sys.argv)
  File "tests/read_from_fd.py", line 15, in main
    in_str = os.read(fd, 1024)
OSError: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "tests/read_from_fd.py", line 20, in <module>
    main(sys.argv)
  File "tests/read_from_fd.py", line 15, in main
    in_str = os.read(fd, 1024)
OSError: [Errno 9] Bad file descriptor
osh4 Multiple here docs in pipeline on multiple lines

[osh stdout] Expected b'0: 3: fd3\n5: fd5\n', got b'0: '

stdout:
0: 
stderr:
Traceback (most recent call last):
  File "tests/read_from_fd.py", line 20, in <module>
    main(sys.argv)
  File "tests/read_from_fd.py", line 15, in main
    in_str = os.read(fd, 1024)
OSError: [Errno 9] Bad file descriptor
Traceback (most recent call last):
  File "tests/read_from_fd.py", line 20, in <module>
    main(sys.argv)
  File "tests/read_from_fd.py", line 15, in main
    in_str = os.read(fd, 1024)
OSError: [Errno 9] Bad file descriptor
osh5 Here doc with bad var delimiter

[osh stdout] Expected b'here\n', got b"<core.base.ParseError object at 0x7f78af49b198>\nLine 1 of '<stdin>'\n cat <<${a}\n ^~\n---\n<core.base.ParseError object at 0x7f78af488fd0>\nLine 0 of '<unknown>'\n <token had no position info>\nNO COL\n---\n"

stdout:
<core.base.ParseError object at 0x7f78af49b198>
Line 1 of '<stdin>'
  cat <<${a}
        ^~
---
<core.base.ParseError object at 0x7f78af488fd0>
Line 0 of '<unknown>'
  <token had no position info>
NO COL
---
stderr:
Error evaluating here doc delimiter: (CompoundWord parts:[(BracedVarSub token:(token id:VSub_Name val:a span_id:4) spids:[35])])
Error parsing AndOr in ParseCommandTerm
bash6 Here doc with bad comsub delimiter

stdout:
here
stderr:
mksh6 Here doc with bad comsub delimiter

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '(' unexpected
osh6 Here doc with bad comsub delimiter

[osh stdout] Expected b'', got b"<core.base.ParseError object at 0x7fecfbf18198>\nLine 1 of '<stdin>'\n cat <<$(a)\n ^~\n---\n<core.base.ParseError object at 0x7fecfbf02fd0>\nLine 0 of '<unknown>'\n <token had no position info>\nNO COL\n---\n"

stdout:
<core.base.ParseError object at 0x7fecfbf18198>
Line 1 of '<stdin>'
  cat <<$(a)
        ^~
---
<core.base.ParseError object at 0x7fecfbf02fd0>
Line 0 of '<unknown>'
  <token had no position info>
NO COL
---
stderr:
Error evaluating here doc delimiter: (CompoundWord
  parts: [
    (CommandSubPart
      command_list: 
        (SimpleCommand
          words: [(CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:a span_id:4))])]
        )
      spids: [3 5]
    )
  ]
)
Error parsing AndOr in ParseCommandTerm
osh7 Here doc and < redirect -- last one wins

[osh stdout] Expected b'hello\n', got b''

stdout:
stderr: 
osh10 Here doc in middle. And redirects in the middle.

[osh stderr] Expected b'foo\nhere\nbar\n', got b'Traceback (most recent call last):\n File "bin/osh", line 378, in <module>\n sys.exit(main(sys.argv))\n File "bin/osh", line 368, in main\n return OshMain(main_argv)\n File "bin/osh", line 327, in OshMain\n status, cflow = ex.Execute(node)\n File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute\n status, cflow = self.Execute(child) # last status wins\n File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 697, in Execute\n self.fd_state.RestoreAll()\n File "/home/andy/git/oil/bin/../core/process.py", line 73, in RestoreAll\n os.close(fd)\nOSError: [Errno 9] Bad file descriptor\n'

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 697, in Execute
    self.fd_state.RestoreAll()
  File "/home/andy/git/oil/bin/../core/process.py", line 73, in RestoreAll
    os.close(fd)
OSError: [Errno 9] Bad file descriptor
mksh15 Here doc with line continuation, then pipe. Syntax error.

stdout:
stderr: 
/bin/mksh: <stdin>[5]: cat: 1: No such file or directory
/bin/mksh: <stdin>[6]: syntax error: '|' unexpected
osh18 Here doc with builtin 'read'

[osh stdout] Expected b'=val1= =val2=\n', got b''

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 378, in <module>
    sys.exit(main(sys.argv))
  File "bin/osh", line 368, in main
    return OshMain(main_argv)
  File "bin/osh", line 327, in OshMain
    status, cflow = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 758, in Execute
    status, cflow = self.Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 663, in Execute
    raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ['Undefined variable v2', 'Error evaluating word part (SimpleVarSub token:(token id:VSub_Name val:"$v2" span_id:16))', 'Error evaluating word (CompoundWord\n  parts: [\n    (LiteralPart token:(token id:Lit_Other val:"=" span_id:15))\n    (SimpleVarSub token:(token id:VSub_Name val:"$v2" span_id:16))\n    (LiteralPart token:(token id:Lit_Other val:"=" span_id:17))\n  ]\n)']
osh19 Compound command here doc

[osh stdout] Expected b'X 1\nX 2\nX 3\n', got b''

stdout:
stderr: 
osh24 Two compound commands with two here docs

[osh stdout] Expected b'X 1\nX 2\n==\nY 3\nY 4\n', got b'==\n'

stdout:
==
stderr:
osh25 Function def and execution with here doc

[osh stdout] Expected b'before\n1\n2\nafter\n', got b'before\nafter\n'

stdout:
before
after
stderr:
dash29 Here doc within subshell with boolean

stdout:
127
stderr:
/bin/dash: 1: [[: not found