Results for oil-regex.test.sh

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

Details on runs that didn't PASS

osh4 _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',)
osh10 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/build/oil/bin/oil.py", line 358, in <module>
    sys.exit(main(sys.argv))
  File "/home/build/oil/bin/oil.py", line 301, in main
    return AppBundleMain(argv)
  File "/home/build/oil/bin/oil.py", line 261, in AppBundleMain
    loader, line_input)
  File "/home/build/oil/core/shell.py", line 682, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/build/oil/core/main_loop.py", line 309, in Batch
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/build/oil/osh/cmd_parse.py", line 2216, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/build/oil/osh/cmd_parse.py", line 2078, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/build/oil/osh/cmd_parse.py", line 2008, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/build/oil/osh/cmd_parse.py", line 1951, in ParsePipeline
    child = self.ParseCommand()
  File "/home/build/oil/osh/cmd_parse.py", line 1878, in ParseCommand
    return self.ParseCompoundCommand()
  File "/home/build/oil/osh/cmd_parse.py", line 1623, in ParseCompoundCommand
    n9 = self.w_parser.ParsePlaceMutation(kw_token, self.var_checker)
  File "/home/build/oil/osh/word_parse.py", line 1037, in ParsePlaceMutation
    enode, last_token = self.parse_ctx.ParsePlaceMutation(kw_token, self.lexer)
  File "/home/build/oil/frontend/parse_lib.py", line 352, in ParsePlaceMutation
    ast_node = self.tr.MakePlaceMutation(pnode)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 691, in MakePlaceMutation
    rhs = self.Expr(children[2])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 451, in Expr
    return self._Tuple(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 226, in _Tuple
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 456, in Expr
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 483, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 487, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 492, in Expr
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 499, in Expr
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 506, in Expr
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 518, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 522, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 526, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 530, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 534, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 538, in Expr
    return self._AssocBinary(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 103, in _AssocBinary
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 544, in Expr
    return self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 556, in Expr
    node = self.Expr(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 447, in Expr
    return self._Atom(children)
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 309, in _Atom
    r = self._Regex(children[1])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 1494, in _Regex
    return self._Regex(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 1510, in _Regex
    r = self._ReAtom(children[i])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 1366, in _ReAtom
    return re.ClassLiteral(False, self._ClassLiteral(p_child))
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 1289, in _ClassLiteral
    terms = [self._ClassLiteralTerm(c) for c in p_node.children[1:-1]]
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 1269, in _ClassLiteralTerm
    start = self._RangeChar(children[0])
  File "/home/build/oil/oil_lang/expr_to_ast.py", line 1183, in _RangeChar
    raise AssertionError('TODO')
AssertionError: TODO
osh13 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/build/oil/bin/oil.py", line 358, in <module>
    sys.exit(main(sys.argv))
  File "/home/build/oil/bin/oil.py", line 301, in main
    return AppBundleMain(argv)
  File "/home/build/oil/bin/oil.py", line 261, in AppBundleMain
    loader, line_input)
  File "/home/build/oil/core/shell.py", line 682, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/build/oil/core/main_loop.py", line 324, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/build/oil/osh/cmd_eval.py", line 1490, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/build/oil/osh/cmd_eval.py", line 1337, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/build/oil/osh/cmd_eval.py", line 1234, in _Dispatch
    status = self._ExecuteList(if_arm.action)
  File "/home/build/oil/osh/cmd_eval.py", line 1393, in _ExecuteList
    status = self._Execute(child)
  File "/home/build/oil/osh/cmd_eval.py", line 1337, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/build/oil/osh/cmd_eval.py", line 599, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/build/oil/osh/word_eval.py", line 1946, in EvalWordSequence2
    return self.SimpleEvalWordSequence2(words, allow_assign)
  File "/home/build/oil/osh/word_eval.py", line 1906, in SimpleEvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/build/oil/osh/word_eval.py", line 1560, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/build/oil/osh/word_eval.py", line 1523, in _EvalWordPart
    s = _Stringify(func(*pos_args, **named_args))
  File "/home/build/oil/oil_lang/funcs_builtin.py", line 90, in __call__
    raise TypeError('Expected an integer, got %r' % arg)
TypeError: Expected an integer, got 'year'
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'
osh22 Match non-ASCII byte denoted using $'\xff' (TODO: LANG=C)

[osh stdout] Expected ' 5b ff 5d 0a\nyes\nno\n', got ' 5b ff 5d 0a\nno\nno\n'

stdout:
 5b ff 5d 0a
no
no
stderr:
osh23 Match non-ASCII byte denoted using \xff (TODO: LANG=C)

[osh stdout] Expected ' 5b ff 5d 0a\nyes\nno\n', got ' 5b ff 5d 0a\nno\nno\n'

stdout:
 5b ff 5d 0a
no
no
stderr: