Results for ysh-regex.test.sh

statusosh
pass 27
FAIL 2
total29
caseoshdescription
0pass /^.$/
1pass /.+/
2pass Repeat {1,3} etc.
3pass d+ digit+ !d+ !digit+
4pass Alternation and sequence
5pass Char Class Ranges
6pass Char Class Set
7pass Range with escaped characters
8pass Group ()
9pass Capture is acceptable as a group
10pass literal ''
11pass Single quotes and splicing (do what "foo $x ${x}" used to)
12pass @splice
13pass splice with capital letters
14pass Repeated String Literal With Single Char
15pass Error when unparenthesized string of more than one character is repeated
16pass Instead of $'foo\\bar' use 'foo' \\ 'bar'
17pass Negation of Character Class ![a-z]
18pass Posix and Perl class in class literals
19pass [!d] can't be negated because it's a literal character
20pass [!digit] can't be negated in POSIX ERE (but yes in Perl)
21pass Operator chars in char classes (bash-like)
22pass Operator chars in char classes (eggex)
23FAIL Matching ] and \ and ' and " in character classes
details
24pass Matching literal hyphen in character classes
25pass Char class special: ^ - ] \
26FAIL character class with digit [\\0] should not crash (issue #2380)
details
27pass Multiple digits like [25] are invalid
28pass Negation of digit not allowed
27 passed, 0 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh23 Matching ] and \ and ' and " in character classes

[osh stdout] Expected 'pat=[]\'"\\\\]\nbackslash \\\nrbracket ]\nsq \'\ndq ""\n' Got ''
[osh status] Expected 0 Got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 263, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 232, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 198, in AppBundleMain
    bash_compat=(applet == 'bash'))
  File "/home/uke/oil/core/shell.py", line 1296, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch2
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/uke/oil/osh/cmd_parse.py", line 2839, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/uke/oil/osh/cmd_parse.py", line 2695, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr
    return self._ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr
    child = self.ParsePipeline()
  File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline
    child = self.ParseCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 2469, in ParseCommand
    n8 = self.w_parser.ParseVarDecl(kw_token)
  File "/home/uke/oil/osh/word_parse.py", line 1334, in ParseVarDecl
    enode, last_token = self.parse_ctx.ParseVarDecl(kw_token, self.lexer)
  File "/home/uke/oil/frontend/parse_lib.py", line 309, in ParseVarDecl
    pnode, last_token = e_parser.Parse(lexer, grammar_nt.ysh_var_decl)
  File "/home/uke/oil/ysh/expr_parse.py", line 357, in Parse
    self.push_parser, lexer)
  File "/home/uke/oil/ysh/expr_parse.py", line 192, in _PushYshTokens
    w = w_parser.ReadWord(lex_mode_e.ShCommand)
  File "/home/uke/oil/osh/word_parse.py", line 2327, in ReadWord
    w = self._ReadWord(word_mode)
  File "/home/uke/oil/osh/word_parse.py", line 2244, in _ReadWord
    return self._ReadCompoundOrRedir(lex_mode)
  File "/home/uke/oil/osh/word_parse.py", line 1892, in _ReadCompoundOrRedir
    return self._ReadCompoundOrRedir3(lex_mode, Id.Undefined_Tok, True)
  File "/home/uke/oil/osh/word_parse.py", line 1997, in _ReadCompoundOrRedir3
    part = self._ReadUnquotedLeftParts(is_triple_quoted)
  File "/home/uke/oil/osh/word_parse.py", line 910, in _ReadUnquotedLeftParts
    dq_part = self._ReadDoubleQuoted(self.cur_token)
  File "/home/uke/oil/osh/word_parse.py", line 1189, in _ReadDoubleQuoted
    self._ReadLikeDQ(left_token, False, parts)
  File "/home/uke/oil/osh/word_parse.py", line 1100, in _ReadLikeDQ
    elif self.token_type == Id.Lit_EscapedDoubleQuote:
AttributeError: type object 'Id' has no attribute 'Lit_EscapedDoubleQuote'
osh26 character class with digit [\\0] should not crash (issue #2380)

[osh stdout] Expected 'pattern: [0\\\\]\n(Bool) true\n(Bool) false\n(Bool) true\n---\n[0-9]\n(Bool) true\n(Bool) false\n' Got ''
[osh status] Expected 0 Got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 263, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 232, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 198, in AppBundleMain
    bash_compat=(applet == 'bash'))
  File "/home/uke/oil/core/shell.py", line 1296, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch2
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/uke/oil/osh/cmd_parse.py", line 2839, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/uke/oil/osh/cmd_parse.py", line 2695, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2619, in ParseAndOr
    return self._ParseAndOr()
  File "/home/uke/oil/osh/cmd_parse.py", line 2630, in _ParseAndOr
    child = self.ParsePipeline()
  File "/home/uke/oil/osh/cmd_parse.py", line 2578, in ParsePipeline
    child = self.ParseCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 2554, in ParseCommand
    return self.ParseSimpleCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 1222, in ParseSimpleCommand
    redirects, words, typed_args, block = self._ScanSimpleCommand()
  File "/home/uke/oil/osh/cmd_parse.py", line 904, in _ScanSimpleCommand
    self._GetWord()
  File "/home/uke/oil/osh/cmd_parse.py", line 670, in _GetWord
    w = self.w_parser.ReadWord(self.next_lex_mode)
  File "/home/uke/oil/osh/word_parse.py", line 2327, in ReadWord
    w = self._ReadWord(word_mode)
  File "/home/uke/oil/osh/word_parse.py", line 2244, in _ReadWord
    return self._ReadCompoundOrRedir(lex_mode)
  File "/home/uke/oil/osh/word_parse.py", line 1892, in _ReadCompoundOrRedir
    return self._ReadCompoundOrRedir3(lex_mode, Id.Undefined_Tok, True)
  File "/home/uke/oil/osh/word_parse.py", line 1997, in _ReadCompoundOrRedir3
    part = self._ReadUnquotedLeftParts(is_triple_quoted)
  File "/home/uke/oil/osh/word_parse.py", line 910, in _ReadUnquotedLeftParts
    dq_part = self._ReadDoubleQuoted(self.cur_token)
  File "/home/uke/oil/osh/word_parse.py", line 1189, in _ReadDoubleQuoted
    self._ReadLikeDQ(left_token, False, parts)
  File "/home/uke/oil/osh/word_parse.py", line 1100, in _ReadLikeDQ
    elif self.token_type == Id.Lit_EscapedDoubleQuote:
AttributeError: type object 'Id' has no attribute 'Lit_EscapedDoubleQuote'