Results for ysh-regex.test.sh

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

Details on runs that didn't PASS

osh-cpp0 /^.$/

[osh-cpp stdout] Expected 'pat=^.$\npat=^.$\nno\nyes\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo pat=$pat
           ^~~~
[ stdin ]:5: fatal: Undefined variable 'pat'
osh-cpp1 /.+/

[osh-cpp stdout] Expected '.+\nyes\nno\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:4: fatal: Undefined variable 'pat'
osh-cpp2 Positional captures with _match

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

stdout:
stderr: 
  if [[ $x =~ ([[:digit:]]+)-([[:digit:]]+) ]] {
        ^~
[ stdin ]:5: fatal: Undefined variable 'x'
osh-cpp3 s ~ regex and s !~ regex

[osh-cpp stdout] Expected "matches\n['foo', 'oo']\ndoes not match\n['foo', 'oo']\ncleared\n" Got ''

stdout:
stderr: 
osh4 _start() and _end()

[osh stdout] Expected 'start=3 end=6\nstart=3 end=6\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/oils_for_unix.py", line 224, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 199, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 146, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 910, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 348, 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 1790, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1616, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1491, in _Dispatch
    status = self._ExecuteList(if_arm.action)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1695, in _ExecuteList
    status = self._Execute(child)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1616, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 727, in _Dispatch
    allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 2157, in EvalWordSequence2
    return self.SimpleEvalWordSequence2(words, allow_assign)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 2117, in SimpleEvalWordSequence2
    self._EvalWordToParts(w, part_vals, 0)  # not quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1715, in _EvalWordToParts
    self._EvalWordPart(p, word_part_vals, eval_flags)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1672, in _EvalWordPart
    part_val = self.expr_ev.EvalExprSub(part)
  File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 667, in EvalExprSub
    py_val = self.EvalExpr(part.child, loc.Missing)
  File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 700, in EvalExpr
    return self._EvalExpr(node)
  File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 1736, in _EvalExpr
    return self._EvalFuncCall(node)
  File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 1413, in _EvalFuncCall
    ret = func(*pos_args, **named_args)
  File "/home/andy/git/oilshell/oil/ysh/funcs_builtin.py", line 104, in __call__
    raise NotImplementedError('_start')
NotImplementedError: _start
osh-cpp4 _start() and _end()

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

stdout:
stderr: 
  if (s ~ / word+ <digit+> /) {
            ^~~~
[ stdin ]:8: 'word' isn't a character class
osh-cpp5 Repeat {1,3} etc.

[osh-cpp stdout] Expected '[[:digit:]]{2}\n[[:digit:]]{1,3}\n[[:digit:]]{1,}\n[[:digit:]]{,3}\n' Got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  setvar pat = /d{2}/
                ^
[ stdin ]:3: 'd' isn't a character class
osh-cpp6 d+ digit+ !d+ !digit+

[osh-cpp stdout] Expected '[[:digit:]]+\nyes\nno\n[[:digit:]]+\n[^[:digit:]]+\n[^[:digit:]]+\n' Got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  setvar pat = /d+/
                ^
[ stdin ]:5: 'd' isn't a character class
osh-cpp7 Alternation and sequence

[osh-cpp stdout] Expected '[[:space:]][[:digit:]]+|[[:alpha:][:digit:]_]*\n[[:space:]][[:digit:]]+|[[:alpha:][:digit:]_]*\n' Got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  setvar pat = /s d+ | w*/
                ^
[ stdin ]:2: 's' isn't a character class
osh-cpp8 Char Class Ranges

[osh-cpp stdout] Expected '[0-9a-f]+\n[0-9a-f]+\nyes\nno\nno\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:5: fatal: Undefined variable 'pat'
osh-cpp9 Char Class Set

[osh-cpp stdout] Expected '[abc]+\nyes\nno\nno\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:6: fatal: Undefined variable 'pat'
osh-cpp10 Range with escaped characters

[osh-cpp stdout] Expected ' 5b 00 2d 0f 5d 0a\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat | od -A n -t x1
       ^~~~
[ stdin ]:6: fatal: Undefined variable 'pat'
  echo $pat | od -A n -t x1
  ^~~~
[ stdin ]:6: errexit PID 25889: command.Pipeline failed with status 1
osh-cpp11 Group ()

[osh-cpp stdout] Expected '(^[[:space:]]|[[:digit:]][[:digit:]])\nyes\nyes\nno\n' Got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  setvar pat = /(%start s or d d)/
                        ^
[ stdin ]:4: 's' isn't a character class
osh-cpp12 Capture is acceptable as a group

[osh-cpp stdout] Expected '(^[[:space:]]|[[:digit:]][[:digit:]])\n', got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  var pat = /<%start s | d d>/
                     ^
[ stdin ]:2: 's' isn't a character class
osh13 Named captures with _match

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

stdout:
stderr: 
    argv.py $[_match('year')] $[_match('month')]
    ^~~~~~~
[ stdin ]:6: fatal: Type error in expression: Expected an integer, got 'year'
osh-cpp13 Named captures with _match

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

stdout:
stderr: 
  if (x ~ /<d+ : year> '-' <d+ : month>/) {
            ^
[ stdin ]:5: 'd' isn't a character class
osh-cpp14 Named Capture Decays Without Name

[osh-cpp stdout] Expected '([[:digit:]]+)\nyes\n', got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  var pat = /<d+ : month>/
              ^
[ stdin ]:2: 'd' isn't a character class
osh15 Operator ~ assigns named 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 ]:7: fatal: Undefined variable 'month'
osh-cpp15 Operator ~ assigns named variable

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

stdout:
stderr: 
  var pat = /<d+ : month>/
              ^
[ stdin ]:2: 'd' isn't a character class
osh-cpp16 literal ''

[osh-cpp stdout] Expected 'abcdef\nno\nyes\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:5: fatal: Undefined variable 'pat'
osh-cpp17 Single quotes and splicing (do what "foo $x ${x}" used to)

[osh-cpp stdout] Expected 'xxabcxy\nno\nyes\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:7: fatal: Undefined variable 'pat'
osh-cpp18 @splice

[osh-cpp stdout] Expected '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\nyes\nno\n' Got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  var d = /d+/;
           ^
[ stdin ]:2: 'd' isn't a character class
osh-cpp19 splice with capital letters

[osh-cpp stdout] Expected '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\nyes\nno\n' Got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  var D = /d+/;
           ^
[ stdin ]:2: 'd' isn't a character class
osh-cpp20 Matching escaped tab character

[osh-cpp stdout] Expected u'pat=(a[\t]b)\naa\tbb\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  write pat=$pat
            ^~~~
[ stdin ]:6: fatal: Undefined variable 'pat'
osh-cpp21 Match unicode char

[osh-cpp stdout] Expected 'yes\nyes\nno\n', got 'no\nno\nno\n'

stdout:
no
no
no
stderr:
osh22 Match non-ASCII byte denoted using $'\xff' (TODO: LANG=C)

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

stdout:
stderr: 
  var pat = /[ $'\xff' ]/;
               ^~
[ stdin ]:2: fatal: Use unquoted char literal for byte 255, which is >= 128 (avoid confusing a set of bytes with a sequence)
osh-cpp22 Match non-ASCII byte denoted using $'\xff' (TODO: LANG=C)

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

stdout:
stderr: 
  echo $pat | od -A n -t x1
       ^~~~
[ stdin ]:4: fatal: Undefined variable 'pat'
  echo $pat | od -A n -t x1
  ^~~~
[ stdin ]:4: errexit PID 26822: command.Pipeline failed with status 1
osh-cpp23 Match non-ASCII byte denoted using \xff

[osh-cpp stdout] Expected ' 5b ff 5d 0a\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat | od -A n -t x1
       ^~~~
[ stdin ]:4: fatal: Undefined variable 'pat'
  echo $pat | od -A n -t x1
  ^~~~
[ stdin ]:4: errexit PID 26885: command.Pipeline failed with status 1
osh-cpp24 ERE can express Unicode escapes that are in the ASCII range

[osh-cpp stdout] Expected ' 5b 7f 5d 0a\nyes\nno\nequal\nyes\nno\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat | od -A n -t x1
       ^~~~
[ stdin ]:4: fatal: Undefined variable 'pat'
  echo $pat | od -A n -t x1
  ^~~~
[ stdin ]:4: errexit PID 26935: command.Pipeline failed with status 1
osh-cpp26 non-ASCII bytes must be singleton terms, e.g. '\x7f\xff' is disallowed

[osh-cpp stdout] Expected u'', got '\n'
[osh-cpp status] Expected 1, got 0

stdout:
stderr: 
osh-cpp27 Matching escaped tab character

[osh-cpp stdout] Expected u'pat=(a[\t]b)\naa\tbb\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  write pat=$pat
            ^~~~
[ stdin ]:6: fatal: Undefined variable 'pat'
osh-cpp28 Repeated String Literal With Single Char

[osh-cpp stdout] Expected '^f+$\n^(f)+$\nyes\nno\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:7: fatal: Undefined variable 'pat'
osh-cpp30 Instead of $'foo\\bar' use 'foo' \\ 'bar'

[osh-cpp stdout] Expected 'foo\\\\bar\nyes\nno\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:3: fatal: Undefined variable 'pat'
osh-cpp31 Negation of Character Class ![a-z]

[osh-cpp stdout] Expected '[^a-z]\nyes\nno\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:4: fatal: Undefined variable 'pat'
osh-cpp32 Posix and Perl class in class literals

[osh-cpp stdout] Expected '[[:space:]z]\n[[:digit:]z]\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo $pat
       ^~~~
[ stdin ]:6: fatal: Undefined variable 'pat'
osh-cpp34 [!digit] can't be negated in POSIX ERE (but yes in Perl)

[osh-cpp stdout] Expected u'', got '\n'
[osh-cpp status] Expected 1, got 0

stdout:
stderr: 
osh-cpp35 Long Python Example

[osh-cpp stdout] Expected 'Y\nN\nY decimal\nN decimal\nY binary\nN binary\nY octal\nN octal\nY hex\nN hex\n' Got ''

stdout:
stderr: 
osh-cpp36 Invalid sh operation on eggex

[osh-cpp status] Expected 1, got 2

stdout:
stderr: 
  var pat = / d+ /
              ^
[ stdin ]:1: 'd' isn't a character class
osh-cpp37 Regex in a loop (bug regression)

[osh-cpp stdout] Expected '1\n2\n', got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
    if (Str(line) ~ / s* 'imports' s* '=' s* .* /) {
                      ^
[ stdin ]:8: 's' isn't a character class
osh-cpp38 Regex in a loop depending on var

[osh-cpp stdout] Expected 'line foo\nmatched foo\nline bar\nmatched bar\n' Got ''

stdout:
stderr: 
osh-cpp39 Regex with [ (bug regression)

[osh-cpp stdout] Expected 'sq\nchar class\n', got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  if ("a" ~ / s* 'imports' s* '=' s* '[' /) {
              ^
[ stdin ]:11: 's' isn't a character class
osh-cpp41 Operator chars in char classes (eggex)

[osh-cpp stdout] Expected 'hyphen\nbackslash\nright bracket\nleft bracket\nperiod\ncaret\nno way to have [^]\n' Got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  [[ '\' =~ $pat ]] && echo backslash
            ^~~~
[ stdin ]:8: fatal: Undefined variable 'pat'
osh-cpp42 Matching ] and \ and ' and " in character classes

[osh-cpp stdout] Expected 'pat=[]\'"\\\\]\nbackslash \\\nrbracket ]\nsq \'\ndq "\n' Got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  write pat=$pat
            ^~~~
[ stdin ]:13: fatal: Undefined variable 'pat'
osh-cpp43 Matching literal hyphen in character classes

[osh-cpp stdout] Expected 'pat=[ab-]\nc-d\nab\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  write pat=$pat
            ^~~~
[ stdin ]:5: fatal: Undefined variable 'pat'
osh-cpp44 Char class special: ^ - ] \

[osh-cpp stdout] Expected 'caret=[x^]\ncaret2=[x^]\ncaret3=[x^]\nmatch x\nmatch ^\n---\nhyphen=[ab-]\nhyphen2=[ab-]\nmatch -\nmatch a\n---\nrbracket=[][]\nrbracket2=[][]\nmatch [\nmatch ]\n---\nbackslash=[xn\\\\]\nbackslash2=[xn\\\\]\nbackslash3=[xn\\\\]\nmatch x\nmatch n\nmatch backslash\n' Got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
  echo caret=$caret
             ^~~~~~
[ stdin ]:5: fatal: Undefined variable 'caret'