Results for oil-regex.test.sh

statusoshosh_ALT
pass 3434
FAIL 44
total3838
caseoshosh_ALTdescription
0pass pass /^.$/
1pass pass /.+/
2pass pass Positional captures with _match
3FAIL FAIL Named captures with _match
detailsdetails
4pass pass s ~ regex and s !~ regex
5FAIL FAIL _start() and _end()
detailsdetails
6pass pass Repeat {1,3} etc.
7pass pass d+ digit+ !d+ !digit+
8pass pass Alternation and sequence
9pass pass Char Class Ranges
10pass pass Char Class Set
11FAIL FAIL Range with escaped characters
detailsdetails
12pass pass Group ()
13pass pass Capture is acceptable as a group
14pass pass Named Capture Decays Without Name
15FAIL FAIL Named Capture With ~ Assigns Variable
detailsdetails
16pass pass literal ''
17pass pass double quoted, $x, and ${x}
18pass pass @splice
19pass pass splice with capital letters
20pass pass Matching escaped tab character
21pass pass Match non-ASCII byte denoted using c'\xff'
22pass pass Match non-ASCII byte denoted using \xff
23pass pass ERE can express Unicode escapes that are in the ASCII range
24pass pass ERE can't express higher Unicode escapes
25pass pass non-ASCII bytes must be singleton terms, e.g. '\x7f\xff' is disallowed
26pass pass Matching escaped tab character
27pass pass Matching ] and \ and ' and " in character classes
28pass pass Matching literal hyphen in character classes
29pass pass Repeated String Literal With Single Char
30pass pass Error when unparenthesized string of more than one character is repeated
31pass pass Instead of c'foo\\bar' use 'foo' \\ 'bar'
32pass pass Negation of Character Class ![a-z]
33pass pass Posix and Perl class in class literals
34pass pass [!d] can't be negated because it's a literal character
35pass pass [!digit] can't be negated in POSIX ERE (but yes in Perl)
36pass pass Long Python Example
37pass pass Invalid sh operation on eggex
68 passed, 0 OK, 0 not implemented, 0 BUG, 4 failed, 0 timeouts, 0 cases skipped
4 failed under osh

Details on runs that didn't PASS

osh3 Named captures with _match

[osh stdout] Expected "['2020', '08']\n", got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 312, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 260, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 220, in AppBundleMain
    loader, line_input)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 633, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1476, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1323, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1220, in _Dispatch
    status = self._ExecuteList(if_arm.action)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1379, in _ExecuteList
    status = self._Execute(child)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1323, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 599, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1910, in EvalWordSequence2
    return self.SimpleEvalWordSequence2(words, allow_assign)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1870, in SimpleEvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1524, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1487, in _EvalWordPart
    s = str(func(*pos_args, **named_args))
  File "/home/andy/git/oilshell/oil/oil_lang/funcs_builtin.py", line 74, in __call__
    raise TypeError('Expected an integer')
TypeError: Expected an integer
osh_ALT3 Named captures with _match

[osh_ALT stdout] Expected "['2020', '08']\n", got ''
[osh_ALT status] Expected 0, got 1
[osh_ALT stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 287, in _cpython_main_hook
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 260, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 220, in AppBundleMain
    loader, line_input)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 633, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 174, in Batch
    return status
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1476, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1323, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1220, in _Dispatch
    status = self._ExecuteList(if_arm.action)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1379, in _ExecuteList
    status = self._Execute(child)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1323, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 636, in _Dispatch
    status = self._Execute(node.child)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1910, in EvalWordSequence2
    return self.SimpleEvalWordSequence2(words, allow_assign)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1870, in SimpleEvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1524, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1506, in _EvalWordPart
    part_vals.append(part_val)
  File "/home/andy/git/oilshell/oil/oil_lang/funcs_builtin.py", line 74, in __call__
    raise TypeError('Expected an integer')
TypeError: Expected an integer
FATAL: couldn't import from app bundle '/home/andy/git/oilshell/oil/_tmp/oil-tar-test/oil-0.8.7/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
osh5 _start() and _end()

[osh stdout] Expected 'start=3 end=6\nstart=3 end=6\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
FATAL: NotImplementedError('_start',)
osh_ALT5 _start() and _end()

[osh_ALT stdout] Expected 'start=3 end=6\nstart=3 end=6\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
FATAL: NotImplementedError('_start',)
osh11 Range with escaped characters

[osh stdout] Expected ' 5b 00 2d 0f 5d 0a\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 312, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 260, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 220, in AppBundleMain
    loader, line_input)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 633, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 153, in Batch
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2227, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2089, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2019, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1965, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1890, in ParseCommand
    return self.ParseCompoundCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1641, in ParseCompoundCommand
    n9 = self.w_parser.ParsePlaceMutation(kw_token, self.var_checker)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 940, in ParsePlaceMutation
    enode, last_token = self.parse_ctx.ParsePlaceMutation(kw_token, self.lexer)
  File "/home/andy/git/oilshell/oil/frontend/parse_lib.py", line 352, in ParsePlaceMutation
    ast_node = self.tr.MakePlaceMutation(pnode)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 685, in MakePlaceMutation
    rhs = self.Expr(children[2])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 451, in Expr
    return self._Tuple(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 226, in _Tuple
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 456, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 483, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 487, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 492, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 499, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 506, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 518, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 522, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 526, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 530, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 534, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 538, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 544, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 556, in Expr
    node = self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 447, in Expr
    return self._Atom(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 309, in _Atom
    r = self._Regex(children[1])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1488, in _Regex
    return self._Regex(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1504, in _Regex
    r = self._ReAtom(children[i])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1360, in _ReAtom
    return re.ClassLiteral(False, self._ClassLiteral(p_child))
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1283, in _ClassLiteral
    terms = [self._ClassLiteralTerm(c) for c in p_node.children[1:-1]]
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1263, in _ClassLiteralTerm
    start = self._RangeChar(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1177, in _RangeChar
    raise AssertionError('TODO')
AssertionError: TODO
osh_ALT11 Range with escaped characters

[osh_ALT stdout] Expected ' 5b 00 2d 0f 5d 0a\n', got ''
[osh_ALT status] Expected 0, got 1
[osh_ALT stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 287, in _cpython_main_hook
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 260, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 220, in AppBundleMain
    loader, line_input)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 633, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 153, in Batch
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2227, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2089, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2019, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1965, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1890, in ParseCommand
    return self.ParseCompoundCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1641, in ParseCompoundCommand
    n9 = self.w_parser.ParsePlaceMutation(kw_token, self.var_checker)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 940, in ParsePlaceMutation
    enode, last_token = self.parse_ctx.ParsePlaceMutation(kw_token, self.lexer)
  File "/home/andy/git/oilshell/oil/frontend/parse_lib.py", line 352, in ParsePlaceMutation
    ast_node = self.tr.MakePlaceMutation(pnode)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 685, in MakePlaceMutation
    rhs = self.Expr(children[2])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 226, in _Tuple
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 608, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 309, in _Atom
    r = self._Regex(children[1])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1488, in _Regex
    return self._Regex(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1504, in _Regex
    r = self._ReAtom(children[i])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1360, in _ReAtom
    return re.ClassLiteral(False, self._ClassLiteral(p_child))
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1283, in _ClassLiteral
    terms = [self._ClassLiteralTerm(c) for c in p_node.children[1:-1]]
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1269, in _ClassLiteralTerm
    return self._NameInClass(children[0].tok, children[1].tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1193, in _RangeChar
    p_die(RANGE_POINT_TOO_LONG, token=tok)
AssertionError: TODO
FATAL: couldn't import from app bundle '/home/andy/git/oilshell/oil/_tmp/oil-tar-test/oil-0.8.7/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
osh15 Named Capture With ~ Assigns Variable

[osh stdout] Expected '([[:digit:]]+)\nyes\nTODO MONTH\n', got '([[:digit:]]+)\nyes\n'
[osh status] Expected 0, got 1

stdout:
([[:digit:]]+)
yes
stderr:
    = month
      ^~~~~
[ stdin ]:6: fatal: Undefined variable 'month'
osh_ALT15 Named Capture With ~ Assigns Variable

[osh_ALT stdout] Expected '([[:digit:]]+)\nyes\nTODO MONTH\n', got '([[:digit:]]+)\nyes\n'
[osh_ALT status] Expected 0, got 1

stdout:
([[:digit:]]+)
yes
stderr:
    = month
      ^~~~~
[ stdin ]:6: fatal: Undefined variable 'month'