Results for var-op-other.test.sh

casedashbashmkshoshosh_ALTdescription
0pass pass pass pass pass String length
1pass pass pass pass pass Length of undefined variable
2ok pass pass pass pass Length of undefined variable with nounset
details
3N-I pass pass FAIL FAIL Cannot take length of substring slice
detailsdetailsdetails
4N-I pass pass pass pass Pattern replacement
details
5N-I pass pass pass pass Global Pattern replacement with /
details
6N-I pass pass pass pass Left Anchored Pattern replacement with #
details
7N-I pass pass pass pass Right Anchored Pattern replacement with %
details
8N-I pass pass pass pass Replace fixed strings
details
9N-I pass pass pass pass Replace is longest match
details
10N-I pass N-I FAIL FAIL Replace char class
detailsdetailsdetailsdetails
11N-I BUG BUG pass pass Pattern replacement ${v/} is not valid
detailsdetailsdetails
12N-I BUG BUG pass pass Pattern replacement ${v//} is not valid
detailsdetailsdetails
13N-I pass pass pass pass ${v/a} is the same as ${v/a/} -- no replacement string
details
14N-I pass pass FAIL FAIL String slice
detailsdetailsdetails
15N-I pass pass FAIL FAIL Negative string slice
detailsdetailsdetails
16N-I pass pass FAIL FAIL String slice with math
detailsdetailsdetails

55 passed, 1 ok, 15 known unimplemented, 4 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
---
osh_ALT3 Cannot take length of substring slice

[osh_ALT 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
dash5 Global Pattern replacement with /

stdout:
stderr: 
/bin/dash: 2: Bad substitution
dash6 Left Anchored Pattern replacement with #

stdout:
stderr: 
/bin/dash: 2: Bad substitution
dash7 Right Anchored Pattern replacement with %

stdout:
stderr: 
/bin/dash: 2: Bad substitution
dash8 Replace fixed strings

stdout:
stderr: 
/bin/dash: 2: Bad substitution
dash9 Replace is longest match

stdout:
stderr: 
/bin/dash: 2: Bad substitution
dash10 Replace char class

stdout:
stderr: 
/bin/dash: 2: Bad substitution
mksh10 Replace char class

stdout:
xx_xx_xx xx_xx_xx
stderr:
osh10 Replace char class

[osh stdout] Expected 'yy_yy_yy xx-xx-xx\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Line 0 of '<unknown>'
  <no position info for token>
osh failed: Can't convert glob to regex: '[[:alpha:]]'
osh_ALT10 Replace char class

[osh_ALT stdout] Expected 'yy_yy_yy xx-xx-xx\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Line 0 of '<unknown>'
  <no position info for token>
osh failed: Can't convert glob to regex: '[[:alpha:]]'
dash11 Pattern replacement ${v/} is not valid

stdout:
stderr: 
/bin/dash: 2: Bad substitution
bash11 Pattern replacement ${v/} is not valid

stdout:
-abcde-
status=0
stderr:
mksh11 Pattern replacement ${v/} is not valid

stdout:
-abcde-
status=0
stderr:
dash12 Pattern replacement ${v//} is not valid

stdout:
stderr: 
/bin/dash: 2: Bad substitution
bash12 Pattern replacement ${v//} is not valid

stdout:
-a/b/c-
status=0
stderr:
mksh12 Pattern replacement ${v//} is not valid

stdout:
-a/b/c-
status=0
stderr:
dash13 ${v/a} is the same as ${v/a/} -- no replacement string

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

stdout:
stderr: 
/bin/dash: 2: Bad substitution
osh14 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 508, in <module>
    main(sys.argv)
  File "bin/osh", line 491, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 474, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 412, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, 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))])
    )
)
osh_ALT14 String slice

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

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 508, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 491, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 474, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 412, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, 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))])
    )
)
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
dash15 Negative string slice

stdout:
stderr: 
/bin/dash: 2: Bad substitution
osh15 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 508, in <module>
    main(sys.argv)
  File "bin/osh", line 491, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 474, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 412, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, 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))])
    )
)
osh_ALT15 Negative string slice

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

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 508, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 491, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 474, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 412, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, 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))])
    )
)
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
dash16 String slice with math

stdout:
stderr: 
/bin/dash: 3: Bad substitution
osh16 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 508, in <module>
    main(sys.argv)
  File "bin/osh", line 491, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 474, in OilMain
    status = OshMain(main_argv, login_shell)
  File "bin/osh", line 412, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, 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))])
        )
    )
)
osh_ALT16 String slice with math

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

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 508, in <module>
    main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 491, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 474, in OilMain
    status = OshMain(main_argv, login_shell)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 412, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 985, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 758, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 978, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 949, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 624, in _Dispatch
    argv = self.ev.EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1106, in EvalWordSequence
    return self._EvalWordSequence(words)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1086, in _EvalWordSequence
    args = self._EvalWordAndReframe(w)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 1039, in _EvalWordAndReframe
    part_vals = self._EvalParts(word)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 933, in _EvalParts
    for v in self.part_ev._EvalWordPart(p, quoted=quoted):
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 892, in _EvalWordPart
    return self._EvalBracedVarSub(part, quoted)
  File "/home/andy/git/oilshell/oil/bin/../core/word_eval.py", line 821, 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))])
        )
    )
)
FATAL: couldn't import from app bundle '_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47