Results for var-op-other.test.sh

casedashbashmkshoshdescription
0pass pass pass pass String length
1pass pass pass pass Length of undefined variable
2ok pass pass pass Length of undefined variable with nounset
details
3N-I pass pass FAIL Cannot take length of substring slice
detailsdetails
4N-I pass pass FAIL Pattern replacement
detailsdetails
5N-I pass pass FAIL String slice
detailsdetails
6N-I pass pass FAIL Negative string slice
detailsdetails
7N-I pass pass FAIL String slice with math
detailsdetails

21 passed, 1 ok, 5 known unimplemented, 0 known bugs, 5 failed, 0 skipped

Details on runs that didn't PASS

dash2 Length of undefined variable with nounset

stdout:
stderr: 
/bin/dash: 2: undef: parameter not set
dash3 Cannot take length of substring slice

stdout:
5
stderr:
osh3 Cannot take length of substring slice

[osh status] Expected 1, got 2

stdout:
stderr: 
Line 2 of '<stdin>'
  echo ${#v:1:3}
           ^
Expected } after length expression, got (token id:VOp2_Colon val:":" span_id:8)
---
Line 2 of '<stdin>'
  echo ${#v:1:3}
           ^
Error reading command word
---
Line 0 of '<unknown>'
  <no position info for token>
Error parsing AndOr in ParseCommandTerm
---
dash4 Pattern replacement

stdout:
stderr: 
/bin/dash: 2: Bad substitution
osh4 Pattern replacement

[osh stdout] Expected 'abXX\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 438, in <module>
    main(sys.argv)
  File "bin/osh", line 425, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 408, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 367, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 849, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 631, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 842, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 548, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1053, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1033, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 986, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 880, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 839, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 765, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (PatSub
  pat: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:"c*" span_id:8))])
  replace: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Chars val:XX span_id:10))])
  do_all: False
  do_prefix: False
  do_suffix: False
)
dash5 String slice

stdout:
stderr: 
/bin/dash: 2: Bad substitution
osh5 String slice

[osh stdout] Expected 'bcd\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 438, in <module>
    main(sys.argv)
  File "bin/osh", line 425, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 408, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 367, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 849, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 631, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 842, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 548, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1053, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1033, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 986, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 880, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 839, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 768, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithWord w:(CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:1 span_id:8))]))
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:10))])
    )
)
dash6 Negative string slice

stdout:
stderr: 
/bin/dash: 2: Bad substitution
osh6 Negative string slice

[osh stdout] Expected 'def\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 438, in <module>
    main(sys.argv)
  File "bin/osh", line 425, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 408, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 367, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 849, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 631, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 842, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 548, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1053, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1033, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 986, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 880, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 839, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 768, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithUnary
      op_id: Node_UnaryMinus
      child: 
        (ArithWord
          w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:4 span_id:10))])
        )
    )
  length: 
    (ArithWord
      w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:12))])
    )
)
dash7 String slice with math

stdout:
stderr: 
/bin/dash: 3: Bad substitution
osh7 String slice with math

[osh stdout] Expected 'def\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 438, in <module>
    main(sys.argv)
  File "bin/osh", line 425, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 408, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 367, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 849, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 631, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 842, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 548, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1053, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 1033, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 986, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 880, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 839, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oil/bin/../core/word_eval.py", line 768, in _EvalBracedVarSub
    raise NotImplementedError(op)
NotImplementedError: (Slice
  begin: 
    (ArithBinary
      op_id: Arith_Minus
      left: 
        (ArithBinary
          op_id: Arith_Minus
          left: (ArithVarRef name:i)
          right: 
            (ArithWord
              w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:3 span_id:14))])
            )
        )
      right: 
        (ArithWord
          w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:16))])
        )
    )
  length: 
    (ArithBinary
      op_id: Arith_Plus
      left: (ArithVarRef name:i)
      right: 
        (ArithWord
          w: (CompoundWord parts:[(LiteralPart token:(token id:Lit_Digits val:2 span_id:24))])
        )
    )
)