Results for regex.test.sh

statusoshosh_.pyosh_.cc
pass 262321
FAIL 257
total282828
caseoshosh_.pyosh_.ccdescription
0pass FAIL FAIL BASH_REMATCH
detailsdetails
1pass pass pass Match is unanchored at both ends
2pass pass pass Failed match
3pass pass pass Regex quoted with \ -- preferred in bash
4pass pass pass Regex quoted with single quotes
5pass pass pass Regex quoted with double quotes
6pass pass pass Fix single quotes by storing in variable
7pass pass pass Fix single quotes by storing in variable
8pass pass pass Double quoting pat variable -- again bash doesn't like it.
9pass pass pass Mixing quoted and unquoted parts
10pass pass pass Regex with == and not =~ is parse error, different lexer mode required
11pass pass pass Omitting ( )
12pass pass FAIL Malformed regex
details
13FAIL FAIL FAIL Regex with char class containing space
detailsdetailsdetails
14FAIL FAIL FAIL Operators and space lose meaning inside ()
detailsdetailsdetails
15pass pass pass Regex with |
16pass pass pass Regex to match literal brackets []
17pass pass pass Regex to match literals . ^ $ etc.
18pass pass FAIL Unquoted { is a regex parse error
details
19pass pass pass Fatal error inside [[ =~ ]]
20pass pass pass Quoted { and +
21pass FAIL FAIL Escaped {
detailsdetails
22pass FAIL FAIL Escaped { stored in variable first
detailsdetails
23pass pass pass regex with ?
24pass pass pass regex with unprintable characters
25pass pass pass pattern $f(x) -- regression
26pass pass pass pattern a=(1)
27pass pass pass pattern @f(x)
70 passed, 0 OK, 0 not implemented, 0 BUG, 14 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh_.py0 BASH_REMATCH

[osh_.py stdout] Expected "['foo123', 'foo', '123']\n", got ''
[osh_.py status] Expected 0, got 127

stdout:
stderr: 
  argv.py "${BASH_REMATCH[@]}"
  ^~~~~~~
[ stdin ]:2: 'argv.py' not found
osh_.cc0 BASH_REMATCH

[osh_.cc stdout] Expected "['foo123', 'foo', '123']\n", got ''
[osh_.cc status] Expected 0, got 127

stdout:
stderr: 
  argv.py "${BASH_REMATCH[@]}"
  ^~~~~~~
[ stdin ]:2: 'argv.py' not found
osh_.cc12 Malformed regex

[osh_.cc status] Expected 2, got 1

stdout:
stderr: 
  [[ 'a b' =~ ^)a\ b($ ]] && echo true
  ^~
[ stdin ]:1: fatal: Invalid regex '^)a b($': Invalid regex syntax (regex_match)
osh13 Regex with char class containing space

[osh stdout] Expected 'true\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
                     ^
[ stdin ]:1: Expected ]]
osh_.py13 Regex with char class containing space

[osh_.py stdout] Expected 'true\n', got ''
[osh_.py status] Expected 0, got 2

stdout:
stderr: 
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
                     ^
[ stdin ]:1: Expected ]]
osh_.cc13 Regex with char class containing space

[osh_.cc stdout] Expected 'true\n', got ''
[osh_.cc status] Expected 0, got 2

stdout:
stderr: 
  [[ 'ba ba ' =~ ([a b]+) ]] && echo true
                     ^
[ stdin ]:1: Expected ]]
osh14 Operators and space lose meaning inside ()

[osh stdout] Expected 'true\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
  [[ '< >' =~ (< >) ]] && echo true
                 ^
[ stdin ]:1: Expected ]]
osh_.py14 Operators and space lose meaning inside ()

[osh_.py stdout] Expected 'true\n', got ''
[osh_.py status] Expected 0, got 2

stdout:
stderr: 
  [[ '< >' =~ (< >) ]] && echo true
                 ^
[ stdin ]:1: Expected ]]
osh_.cc14 Operators and space lose meaning inside ()

[osh_.cc stdout] Expected 'true\n', got ''
[osh_.cc status] Expected 0, got 2

stdout:
stderr: 
  [[ '< >' =~ (< >) ]] && echo true
                 ^
[ stdin ]:1: Expected ]]
osh_.cc18 Unquoted { is a regex parse error

[osh_.cc status] Expected 2, got 1

stdout:
stderr: 
  [[ { =~ { ]] && echo true
  ^~
[ stdin ]:1: fatal: Invalid regex '{': Invalid regex syntax (regex_match)
osh_.py21 Escaped {

[osh_.py stdout] Expected "['$PA', '$', 'PA']\n", got ''
[osh_.py status] Expected 0, got 127

stdout:
stderr: 
  [[ '$PA' =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]] && argv.py "${BASH_REMATCH[@]}"
                                             ^~~~~~~
[ stdin ]:1: 'argv.py' not found
osh_.cc21 Escaped {

[osh_.cc stdout] Expected "['$PA', '$', 'PA']\n", got ''
[osh_.cc status] Expected 0, got 127

stdout:
stderr: 
  [[ '$PA' =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]] && argv.py "${BASH_REMATCH[@]}"
                                             ^~~~~~~
[ stdin ]:1: 'argv.py' not found
osh_.py22 Escaped { stored in variable first

[osh_.py stdout] Expected "['$PA', '$', 'PA']\n", got ''
[osh_.py status] Expected 0, got 127

stdout:
stderr: 
  [[ '$PA' =~ $pat ]] && argv.py "${BASH_REMATCH[@]}"
                         ^~~~~~~
[ stdin ]:2: 'argv.py' not found
osh_.cc22 Escaped { stored in variable first

[osh_.cc stdout] Expected "['$PA', '$', 'PA']\n", got ''
[osh_.cc status] Expected 0, got 127

stdout:
stderr: 
  [[ '$PA' =~ $pat ]] && argv.py "${BASH_REMATCH[@]}"
                         ^~~~~~~
[ stdin ]:2: 'argv.py' not found