Results for oil-regex.test.sh

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

osh2 Positional captures with _match

[osh stdout] Expected "['2020-08', '2020', '08']\n['reset']\n['2020-08', '2020', '08']\n", got "['2020-08', '2020', '08']\n['reset']\n"
[osh status] Expected 0, got 1

stdout:
['2020-08', '2020', '08']
['reset']
stderr:
    argv.py $_match(0) $_match(1) $_match(2)
    ^~~~~~~
[ stdin ]:9: fatal: Expected function named '_match', got (value.Undef) 
osh_ALT2 Positional captures with _match

[osh_ALT stdout] Expected "['2020-08', '2020', '08']\n['reset']\n['2020-08', '2020', '08']\n", got "['2020-08', '2020', '08']\n['reset']\n"
[osh_ALT status] Expected 0, got 1

stdout:
['2020-08', '2020', '08']
['reset']
stderr:
    argv.py $_match(0) $_match(1) $_match(2)
    ^~~~~~~
[ stdin ]:9: fatal: Expected function named '_match', got (value.Undef) 
osh3 Named captures with _match

[osh stdout] Expected "['2020', '08']\n", got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
    argv.py $_match('year') $_match('month')
    ^~~~~~~
[ stdin ]:4: fatal: Expected function named '_match', got (value.Undef) 
osh_ALT3 Named captures with _match

[osh_ALT stdout] Expected "['2020', '08']\n", got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
    argv.py $_match('year') $_match('month')
    ^~~~~~~
[ stdin ]:4: fatal: Expected function named '_match', got (value.Undef) 
osh9 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 380, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 324, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 283, in AppBundleMain
    loader, line_input)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 640, 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 2054, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1916, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1846, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1792, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1709, in ParseCommand
    return self.ParseCompoundCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1485, in ParseCompoundCommand
    return self.w_parser.ParsePlaceMutation(kw_token)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 920, 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 687, in MakePlaceMutation
    rhs = self.Expr(children[2])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 453, in Expr
    return self._Tuple(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 228, in _Tuple
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 458, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 485, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 489, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 494, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 501, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 508, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 520, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 524, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 528, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 532, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 536, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 540, in Expr
    return self._AssocBinary(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 546, in Expr
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 558, in Expr
    node = self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 449, in Expr
    return self._Atom(children)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 311, in _Atom
    r = self._Regex(children[1])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1412, in _Regex
    return self._Regex(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1428, in _Regex
    r = self._ReAtom(children[i])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1284, in _ReAtom
    return re.ClassLiteral(False, self._ClassLiteral(p_child))
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1207, 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 1187, in _ClassLiteralTerm
    start = self._RangeChar(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1101, in _RangeChar
    raise AssertionError('TODO')
AssertionError: TODO
osh_ALT9 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 355, in _cpython_main_hook
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 324, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 316, in AppBundleMain
    return readlink.main(main_argv)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 640, 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 2054, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1916, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1846, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1792, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1709, in ParseCommand
    return self.ParseCompoundCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1485, in ParseCompoundCommand
    return self.w_parser.ParsePlaceMutation(kw_token)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 920, 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 687, in MakePlaceMutation
    rhs = self.Expr(children[2])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 228, in _Tuple
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 102, in _AssocBinary
    return self.Expr(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 610, in Expr
    return expr.Var(tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 311, in _Atom
    r = self._Regex(children[1])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1412, in _Regex
    return self._Regex(children[0])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1428, in _Regex
    r = self._ReAtom(children[i])
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1284, in _ReAtom
    return re.ClassLiteral(False, self._ClassLiteral(p_child))
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1207, 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 1193, in _ClassLiteralTerm
    return self._NameInClass(children[0].tok, children[1].tok)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_to_ast.py", line 1117, 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.2/_bin/osh' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
osh13 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_ALT13 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'