Results for var-op-patsub.test.sh

statusoshosh_.pyosh_.cc
pass 22223
N-I 110
FAIL 2222
total252525
caseoshosh_.pyosh_.ccdescription
0pass pass FAIL Pattern replacement
details
1pass pass FAIL Pattern replacement on unset variable
details
2pass pass FAIL Global Pattern replacement with /
details
3pass pass FAIL Left Anchored Pattern replacement with #
details
4pass pass FAIL Right Anchored Pattern replacement with %
details
5pass pass FAIL Replace fixed strings
details
6pass pass FAIL Replace is longest match
details
7pass pass FAIL Replace char class
details
8pass pass FAIL Replace hard glob
details
9pass pass pass Pattern replacement ${v/} is not valid
10pass pass pass Pattern replacement ${v//} is not valid
11pass pass FAIL Confusing unquoted slash matches bash (and ash)
details
12pass pass FAIL ${v/a} is the same as ${v/a/} -- no replacement string
details
13pass pass FAIL Replacement with special chars (bug fix)
details
14pass pass FAIL Replace backslash
details
15pass pass FAIL Replace right ]
details
16pass pass FAIL Substitute glob characters in pattern, quoted and unquoted
details
17pass FAIL FAIL Substitute one unicode character (UTF-8)
detailsdetails
18FAIL pass FAIL Can't substitute one unicode character when LANG=C
detailsdetails
19pass pass FAIL ${x/^} regression
details
20pass pass FAIL \(\) in pattern (regression)
details
21N-I N-I FAIL Extended globs! (not supported in Oil)
detailsdetailsdetails
22pass pass FAIL patsub with single quotes and hyphen in character class (regression)
details
23FAIL FAIL FAIL patsub with [^]]
detailsdetailsdetails
24pass pass pass patsub syntax error
47 passed, 0 OK, 2 not implemented, 0 BUG, 26 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh_.cc0 Pattern replacement

[osh_.cc stdout] Expected 'abXX\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1738
	gNumDelete = 114
	gMemPos = 60544

	gNumMalloc = 63
	gNumFree = 0
	gMemPos2 = 9424
osh_.cc1 Pattern replacement on unset variable

[osh_.cc stdout] Expected '--\nstatus=0\n', got ''

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1707
	gNumDelete = 110
	gMemPos = 59856

	gNumMalloc = 59
	gNumFree = 0
	gMemPos2 = 9360
osh_.cc2 Global Pattern replacement with /

[osh_.cc stdout] Expected 'yy_xx_xx yy_yy_xx\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1767
	gNumDelete = 122
	gMemPos = 61536

	gNumMalloc = 71
	gNumFree = 0
	gMemPos2 = 9552
osh_.cc3 Left Anchored Pattern replacement with #

[osh_.cc stdout] Expected 'xx_yy_xx xx_xx_xx\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1767
	gNumDelete = 122
	gMemPos = 61536

	gNumMalloc = 71
	gNumFree = 0
	gMemPos2 = 9552
osh_.cc4 Right Anchored Pattern replacement with %

[osh_.cc stdout] Expected 'xx_yy_xx xx_xx_yy\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1767
	gNumDelete = 122
	gMemPos = 61536

	gNumMalloc = 71
	gNumFree = 0
	gMemPos2 = 9552
osh_.cc5 Replace fixed strings

[osh_.cc stdout] Expected 'yy_xx yy_yy yy_xx xx_yy\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1816
	gNumDelete = 130
	gMemPos = 63456

	gNumMalloc = 86
	gNumFree = 0
	gMemPos2 = 9792
osh_.cc6 Replace is longest match

[osh_.cc stdout] Expected 'begin [] end\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1759
	gNumDelete = 125
	gMemPos = 61312

	gNumMalloc = 69
	gNumFree = 0
	gMemPos2 = 9568
osh_.cc7 Replace char class

[osh_.cc stdout] Expected 'yy_yy_yy xx-xx-xx\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ${s//[[:alpha:]]/y} ${s//[^[:alpha:]]/-}
  ^~~~
[ stdin ]:2: fatal: Error matching regex '([[:alpha:]])': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1795
	gNumDelete = 133
	gMemPos = 62448

	gNumMalloc = 80
	gNumFree = 0
	gMemPos2 = 9728
osh_.cc8 Replace hard glob

[osh_.cc stdout] Expected 'aa__cc\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ${s//\**+/__}  # Literal *, then any sequence of characters, then literal +
  ^~~~
[ stdin ]:2: fatal: Error matching regex '(\\*.*\\+)': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1770
	gNumDelete = 124
	gMemPos = 61696

	gNumMalloc = 76
	gNumFree = 0
	gMemPos2 = 9712
osh_.cc11 Confusing unquoted slash matches bash (and ash)

[osh_.cc stdout] Expected 'c_c\nc_c\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ${x////c}
  ^~~~
[ stdin ]:2: fatal: Error matching regex '(/)': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1753
	gNumDelete = 115
	gMemPos = 60960

	gNumMalloc = 69
	gNumFree = 0
	gMemPos2 = 9520
osh_.cc12 ${v/a} is the same as ${v/a/} -- no replacement string

[osh_.cc stdout] Expected 'abb\nstatus=0\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1736
	gNumDelete = 114
	gMemPos = 60496

	gNumMalloc = 62
	gNumFree = 0
	gMemPos2 = 9408
osh_.cc13 Replacement with special chars (bug fix)

[osh_.cc stdout] Expected '?x\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1742
	gNumDelete = 114
	gMemPos = 60640

	gNumMalloc = 64
	gNumFree = 0
	gMemPos2 = 9440
osh_.cc14 Replace backslash

[osh_.cc stdout] Expected '[_]\n[\\_]\n[\\_]\n[_]\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1804
	gNumDelete = 128
	gMemPos = 62352

	gNumMalloc = 79
	gNumFree = 0
	gMemPos2 = 9680
osh_.cc15 Replace right ]

[osh_.cc stdout] Expected '--_--\n--_--\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1801
	gNumDelete = 126
	gMemPos = 62272

	gNumMalloc = 78
	gNumFree = 0
	gMemPos2 = 9664
osh_.cc16 Substitute glob characters in pattern, quoted and unquoted

[osh_.cc stdout] Expected 'a-b\n-\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ${v//"$g"/-}
  ^~~~
[ stdin ]:3: fatal: Error matching regex '(\\*)': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1810
	gNumDelete = 127
	gMemPos = 62544

	gNumMalloc = 82
	gNumFree = 0
	gMemPos2 = 9744
osh_.py17 Substitute one unicode character (UTF-8)

[osh_.py stdout] Expected 'foo and foo\nfoo and _\xce\xbc_\n_\xce\xbc_ and foo\n', got '_\xce\xbc_ and _\xce\xbc_\n_\xce\xbc_ and _\xce\xbc_\n_\xce\xbc_ and _\xce\xbc_\n'

stdout:
_μ_ and _μ_
_μ_ and _μ_
_μ_ and _μ_
stderr:
osh_.cc17 Substitute one unicode character (UTF-8)

[osh_.cc stdout] Expected 'foo and foo\nfoo and _\xce\xbc_\n_\xce\xbc_ and foo\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ${s//_?_/foo}  # all
  ^~~~
[ stdin ]:3: fatal: Error matching regex '(_._)': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1846
	gNumDelete = 139
	gMemPos = 63536

	gNumMalloc = 82
	gNumFree = 0
	gMemPos2 = 9744
osh18 Can't substitute one unicode character when LANG=C

[osh stdout] Expected '_\xce\xbc_ and _\xce\xbc_\n_\xce\xbc_ and _\xce\xbc_\n_\xce\xbc_ and _\xce\xbc_\n', got 'foo and foo\nfoo and _\xce\xbc_\n_\xce\xbc_ and foo\n'

stdout:
foo and foo
foo and _μ_
_μ_ and foo
stderr:
osh_.cc18 Can't substitute one unicode character when LANG=C

[osh_.cc stdout] Expected '_\xce\xbc_ and _\xce\xbc_\n_\xce\xbc_ and _\xce\xbc_\n_\xce\xbc_ and _\xce\xbc_\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ${s//_?_/foo}  # all
  ^~~~
[ stdin ]:4: fatal: Error matching regex '(_._)': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1929
	gNumDelete = 157
	gMemPos = 66096

	gNumMalloc = 92
	gNumFree = 0
	gMemPos2 = 9904
osh_.cc19 ${x/^} regression

[osh_.cc stdout] Expected 'abc\nabc\n^^\n^^^\n!!!\n!!\nb!c\na^c\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
osh fatal error: Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1728
	gNumDelete = 113
	gMemPos = 60304

	gNumMalloc = 59
	gNumFree = 0
	gMemPos2 = 9360
osh_.cc20 \(\) in pattern (regression)

[osh_.cc stdout] Expected '1 z\n2 z\n3 fooz\n4 z\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo 1 ${x//*\(\)/z}
  ^~~~
[ stdin ]:2: fatal: Error matching regex '(.*\\(\\))': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1802
	gNumDelete = 133
	gMemPos = 62528

	gNumMalloc = 86
	gNumFree = 0
	gMemPos2 = 9808
osh21 Extended globs! (not supported in Oil)

stdout:
ext foo()
ext foo()
stderr:
osh_.py21 Extended globs! (not supported in Oil)

stdout:
ext foo()
ext foo()
stderr:
osh_.cc21 Extended globs! (not supported in Oil)

[osh_.cc stdout] Expected 'ext foo()\next foo()\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ext ${x//*(foo|bar)/z}
  ^~~~
[ stdin ]:3: fatal: Error matching regex '(.*\\(foo\\|bar\\))': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1992
	gNumDelete = 167
	gMemPos = 68064

	gNumMalloc = 151
	gNumFree = 0
	gMemPos2 = 10848
osh_.cc22 patsub with single quotes and hyphen in character class (regression)

[osh_.cc stdout] Expected '++--.,<>[]\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  program=${program//[^'><+-.,[]']} 
  ^~~~~~~~
[ stdin ]:2: fatal: Error matching regex '([^]><+.,\\[-])': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1759
	gNumDelete = 135
	gMemPos = 61760

	gNumMalloc = 61
	gNumFree = 0
	gMemPos2 = 9472
osh23 patsub with [^]]

[osh stdout] Expected 'ab^cd^\n', got 'zzzzzz\n'

stdout:
zzzzzz
stderr:
osh_.py23 patsub with [^]]

[osh_.py stdout] Expected 'ab^cd^\n', got 'zzzzzz\n'

stdout:
zzzzzz
stderr:
osh_.cc23 patsub with [^]]

[osh_.cc stdout] Expected 'ab^cd^\n', got ''
[osh_.cc status] Expected 0, got 1

stdout:
stderr: 
  echo ${s//$pat/z}
  ^~~~
[ stdin ]:3: fatal: Error matching regex '([^]\\])': Invalid locale for LC_CTYPE

dumb_alloc:
	gNumNew = 1810
	gNumDelete = 127
	gMemPos = 62544

	gNumMalloc = 81
	gNumFree = 0
	gMemPos2 = 9728