Results for builtin-printf.test.sh

statusbashdashashzshmkshkshtoyshsushbrushosh
pass 52343236333533123441
ok 4325500008
N-I 01717111500007
BUG 0254300000
FAIL 00000212344210
TIME 0000000010
total56565656565656565656
casebashdashashzshmkshkshtoyshsushbrushoshdescription
0pass pass pass ok ok FAIL FAIL pass pass pass printf with no args
detailsdetailsdetailsdetails
1pass N-I N-I N-I N-I FAIL FAIL pass pass pass printf -v %s
detailsdetailsdetailsdetailsdetailsdetails
2pass N-I N-I N-I N-I FAIL FAIL FAIL pass pass printf -v %q
detailsdetailsdetailsdetailsdetailsdetailsdetails
3pass N-I N-I N-I N-I FAIL FAIL pass pass pass printf -v a[1]
detailsdetailsdetailsdetailsdetailsdetails
4pass pass N-I N-I N-I FAIL FAIL FAIL FAIL pass printf -v syntax error
detailsdetailsdetailsdetailsdetailsdetailsdetails
5pass N-I N-I pass N-I FAIL pass FAIL FAIL pass dynamic declare instead of %s
detailsdetailsdetailsdetailsdetailsdetails
6pass N-I N-I N-I N-I FAIL FAIL FAIL FAIL ok dynamic declare instead of %q
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
7pass N-I N-I N-I N-I FAIL FAIL pass pass ok printf -v dynamic scope
detailsdetailsdetailsdetailsdetailsdetailsdetails
8pass pass pass pass pass pass pass FAIL pass pass printf with too few arguments
details
9pass pass pass pass pass pass pass FAIL pass pass printf with too many arguments
details
10pass pass pass pass pass pass pass pass pass pass printf width strings
11pass pass pass pass pass pass pass FAIL pass pass printf integer
details
12pass pass pass pass pass pass FAIL FAIL pass pass printf %6.4d -- "precision" does padding for integers
detailsdetails
13pass pass pass pass pass pass FAIL FAIL pass pass printf %6.4x X o
detailsdetails
14pass pass pass pass pass pass FAIL FAIL pass pass %06d zero padding vs. %6.6d
detailsdetails
15pass pass pass pass pass pass pass pass pass pass %06x %06X %06o
16pass pass pass pass ok FAIL pass pass FAIL pass %06s is no-op
detailsdetailsdetails
17pass pass pass pass pass pass pass FAIL pass pass printf %6.4s does both truncation and padding
details
18pass pass pass pass N-I FAIL pass FAIL FAIL pass printf %6.0s and %0.0s
detailsdetailsdetailsdetails
19pass pass pass BUG N-I FAIL pass FAIL FAIL pass printf %6.s and %0.s
detailsdetailsdetailsdetailsdetails
20pass pass pass pass pass pass pass FAIL pass pass printf %*.*s (width/precision from args)
details
21pass pass pass pass pass pass pass FAIL pass pass unsigned / octal / hex
details
22pass pass pass pass BUG FAIL pass pass pass pass unsigned / octal / hex big
detailsdetails
23pass pass ok pass pass pass pass FAIL pass ok empty string (osh is more strict)
detailsdetailsdetails
24pass pass pass pass ok FAIL pass FAIL pass pass No char after ' => zero code point
detailsdetailsdetails
25pass BUG BUG pass BUG pass FAIL FAIL pass pass Unicode char with '
detailsdetailsdetailsdetailsdetails
26pass pass pass pass pass pass pass FAIL FAIL pass Invalid UTF-8
detailsdetails
27pass BUG BUG pass BUG pass FAIL FAIL FAIL ok Too large
detailsdetailsdetailsdetailsdetailsdetailsdetails
28pass pass pass pass pass pass pass pass pass N-I negative numbers with unsigned / octal / hex
details
29pass pass pass pass pass pass pass FAIL pass N-I printf floating point (not required, but they all implement it)
detailsdetails
30pass pass pass pass pass pass pass FAIL pass N-I printf floating point with - and 0
detailsdetails
31pass pass pass pass pass pass pass FAIL pass N-I printf eE fF gG
detailsdetails
32pass N-I pass pass pass pass pass FAIL pass pass printf backslash escapes
detailsdetails
33pass pass pass pass pass pass pass FAIL FAIL pass printf octal backslash escapes
detailsdetails
34pass N-I N-I pass pass pass FAIL FAIL pass pass printf unicode backslash escapes
detailsdetailsdetailsdetails
35pass pass pass pass pass pass pass pass pass pass printf invalid backslash escape (is ignored)
36pass pass pass pass pass pass pass FAIL pass pass printf % escapes
details
37pass pass pass pass pass pass pass FAIL pass pass printf %b backslash escaping
details
38pass pass pass pass pass pass pass FAIL FAIL pass printf %b with \c early return
detailsdetails
39pass N-I N-I pass pass pass pass FAIL pass N-I printf %c -- doesn't respect UTF-8! Bad.
detailsdetailsdetailsdetails
40pass ok pass pass pass pass pass pass pass ok printf invalid format
detailsdetails
41ok N-I N-I ok pass pass FAIL FAIL pass pass printf %q
detailsdetailsdetailsdetailsdetailsdetails
42ok N-I N-I ok N-I FAIL FAIL FAIL FAIL pass printf %6q (width)
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
43pass pass ok ok pass pass pass FAIL FAIL ok printf negative numbers
detailsdetailsdetailsdetailsdetails
44pass pass pass pass pass pass pass FAIL pass N-I printf + and space flags
detailsdetails
45pass pass pass pass pass pass pass FAIL pass N-I printf # flag
detailsdetails
46pass pass BUG BUG pass pass pass FAIL FAIL ok Runtime error for invalid integer
detailsdetailsdetailsdetailsdetails
47pass N-I N-I N-I N-I FAIL FAIL FAIL FAIL pass %(strftime format)T
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
48pass N-I N-I N-I N-I FAIL FAIL FAIL FAIL pass %(strftime format)T doesn't respect TZ if not exported
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
49pass N-I N-I N-I N-I FAIL FAIL FAIL FAIL pass %(strftime format)T TZ in environ but not in shell's memory
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
50pass N-I N-I N-I N-I FAIL FAIL FAIL FAIL pass %10.5(strftime format)T
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
51pass pass pass pass pass pass pass pass TIME pass Regression for 'printf x y'
52pass N-I N-I N-I N-I FAIL FAIL FAIL FAIL ok bash truncates long strftime string at 128
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
53pass N-I N-I ok pass pass FAIL FAIL FAIL pass printf with explicit NUL byte
detailsdetailsdetailsdetailsdetailsdetails
54ok ok BUG BUG ok FAIL FAIL FAIL FAIL pass printf positive integer overflow
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
55ok ok BUG BUG ok FAIL FAIL FAIL FAIL pass printf negative integer overflow
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
342 passed, 27 OK, 67 not implemented, 14 BUG, 109 failed, 1 timeouts, 0 cases skipped

Details on runs that didn't PASS

zsh0 printf with no args

stdout:
stderr: 
printf: not enough arguments
mksh0 printf with no args

stdout:
stderr: 
printf: missing operand
Try 'printf --help' for more information.
ksh0 printf with no args

[ksh status] Expected 2, got 1

stdout:
stderr: 
printf: missing operand
Try 'printf --help' for more information.
toysh0 printf with no args

[toysh status] Expected 2, got 1

stdout:
stderr: 
printf: Needs 1 argument (see "printf --help")
dash1 printf -v %s

stdout:
['']
stderr:
dash: 2: printf: Illegal option -v
ash1 printf -v %s

stdout:
-v['']
stderr:
zsh1 printf -v %s

stdout:
-v['']
stderr:
mksh1 printf -v %s

stdout:
-v['']
stderr:
printf: warning: ignoring excess arguments, starting with ‘foo’
ksh1 printf -v %s

[ksh stdout] Expected "['hello there']\n", got "-v['']\n"

stdout:
-v['']
stderr:
printf: warning: ignoring excess arguments, starting with ‘foo’
toysh1 printf -v %s

[toysh stdout] Expected "['hello there']\n", got "-v['']\n"

stdout:
-v['']
stderr:
dash2 printf -v %q

stdout:
stderr: 
dash: 3: printf: Illegal option -v
ash2 printf -v %q

stdout:
-v
stderr:
zsh2 printf -v %q

stdout:
-v
stderr:
mksh2 printf -v %q

stdout:
-v
stderr:
printf: warning: ignoring excess arguments, starting with ‘foo’
ksh2 printf -v %q

[ksh stdout] Expected 'OK\n', got '-v'
[ksh status] Expected 0, got 1

stdout:
-v
stderr:
printf: warning: ignoring excess arguments, starting with ‘foo’
toysh2 printf -v %q

[toysh stdout] Expected 'OK\n', got '-v'
[toysh status] Expected 0, got 1

stdout:
-v
stderr:
sush2 printf -v %q

[sush stdout] Expected 'OK\n', got ''
[sush status] Expected 0, got 1

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: with: command not found
dash3 printf -v a[1]

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
ash3 printf -v a[1]

stdout:
stderr: 
ash: syntax error: unexpected "("
zsh3 printf -v a[1]

stdout:
-vstatus=0
['a', 'b', 'c']
stderr:
mksh3 printf -v a[1]

stdout:
-vstatus=0
['a', 'b', 'c']
stderr:
printf: warning: ignoring excess arguments, starting with ‘a[1]’
ksh3 printf -v a[1]

[ksh stdout] Expected "status=0\n['a', 'foo', 'c']\n", got "-vstatus=0\n['a', 'b', 'c']\n"

stdout:
-vstatus=0
['a', 'b', 'c']
stderr:
printf: warning: ignoring excess arguments, starting with ‘a[1]’
toysh3 printf -v a[1]

[toysh stdout] Expected "status=0\n['a', 'foo', 'c']\n", got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: a
ash4 printf -v syntax error

stdout:
-vstatus=0
stderr:
zsh4 printf -v syntax error

stdout:
-vstatus=0
stderr:
mksh4 printf -v syntax error

stdout:
-vstatus=0
stderr:
printf: warning: ignoring excess arguments, starting with ‘a[’
ksh4 printf -v syntax error

[ksh stdout] Expected 'status=2\n', got '-vstatus=0\n'

stdout:
-vstatus=0
stderr:
printf: warning: ignoring excess arguments, starting with ‘a[’
toysh4 printf -v syntax error

[toysh stdout] Expected 'status=2\n', got '-vstatus=0\n'

stdout:
-vstatus=0
stderr:
sush4 printf -v syntax error

[sush stdout] Expected 'status=2\n', got 'status=1\n'

stdout:
status=1
stderr:
brush4 printf -v syntax error

[brush stdout] Expected 'status=2\n', got 'status=1\n'

stdout:
status=1
stderr:
ERROR failed to parse parameter 'a['
dash5 dynamic declare instead of %s

stdout:
['']
stderr:
dash: 2: declare: not found
ash5 dynamic declare instead of %s

stdout:
['']
stderr:
ash: declare: not found
mksh5 dynamic declare instead of %s

stdout:
['']
stderr:
mksh: <stdin>[2]: declare: not found
ksh5 dynamic declare instead of %s

[ksh stdout] Expected "['hello there']\n", got "['']\n"

stdout:
['']
stderr:
E: ksh: <stdin>[2]: declare: inaccessible or not found
sush5 dynamic declare instead of %s

[sush stdout] Expected "['hello there']\n", got "['']\n"

stdout:
['']
stderr:
brush5 dynamic declare instead of %s

[brush stdout] Expected "['hello there']\n", got "['']\n"

stdout:
['']
stderr:
dash6 dynamic declare instead of %q

stdout:
stderr: 
dash: 3: Bad substitution
ash6 dynamic declare instead of %q

stdout:
stderr: 
ash: syntax error: bad substitution
zsh6 dynamic declare instead of %q

stdout:
stderr: 
zsh: bad substitution
mksh6 dynamic declare instead of %q

stdout:
stderr: 
mksh: <stdin>[3]: declare: not found
ksh6 dynamic declare instead of %q

[ksh stdout] Expected '\'"quoted" with spaces and \\\'\n', got '\n'

stdout:
stderr: 
E: ksh: <stdin>[3]: declare: inaccessible or not found
toysh6 dynamic declare instead of %q

[toysh stdout] Expected '\'"quoted" with spaces and \\\'\n', got '\n'

stdout:
stderr: 
main: line 3: sh: val: @Q}"
sush6 dynamic declare instead of %q

[sush stdout] Expected '\'"quoted" with spaces and \\\'\n', got '\n'

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: `${val@Q}': bad substitution
brush6 dynamic declare instead of %q

[brush stdout] Expected '\'"quoted" with spaces and \\\'\n', got '\n'

stdout:
stderr: 
osh6 dynamic declare instead of %q

stdout:
$'"quoted" with spaces and \\'
stderr:
dash7 printf -v dynamic scope

stdout:
not implemented
stderr:
ash7 printf -v dynamic scope

stdout:
not implemented
stderr:
zsh7 printf -v dynamic scope

stdout:
not implemented
stderr:
mksh7 printf -v dynamic scope

stdout:
not implemented
stderr:
ksh7 printf -v dynamic scope

[ksh stdout] Expected 'dollar=dollar\n--\ndollar=\\$\nmylocal=mylocal\n--\ndollar=\\$\nmylocal=\n' Got 'dollar=dollar\n--\n-v-vdollar=dollar\nmylocal=foo\n--\ndollar=dollar\nmylocal=\n'

stdout:
dollar=dollar
--
-v-vdollar=dollar
mylocal=foo
--
dollar=dollar
mylocal=
stderr:
printf: warning: ignoring excess arguments, starting with ‘dollar’
printf: warning: ignoring excess arguments, starting with ‘mylocal’
toysh7 printf -v dynamic scope

[toysh stdout] Expected 'dollar=dollar\n--\ndollar=\\$\nmylocal=mylocal\n--\ndollar=\\$\nmylocal=\n' Got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
osh7 printf -v dynamic scope

stdout:
dollar=dollar
--
dollar='$'
mylocal=mylocal
--
dollar='$'
mylocal=
stderr:
sush8 printf with too few arguments

[sush stdout] Expected '-a b-x y--\n', got '--'

stdout:
--
stderr:
sush9 printf with too many arguments

[sush stdout] Expected '-a-b-\n-c-d-\n-e--\n', got '--'

stdout:
--
stderr:
sush11 printf integer

[sush stdout] Expected '42\n42\n97\n97\n[ 42]\n[42 ]\n[00042]\n', got '42\n42\n\'a\n"a\n[ 42]\n[42 ]\n[00042]\n'

stdout:
42
42
'a
"a
[   42]
[42   ]
[00042]
stderr:
toysh12 printf %6.4d -- "precision" does padding for integers

[toysh stdout] Expected '[ 0042]\n[0042]\n[ 42]\n--\n[ -0042]\n[-0042]\n[ -42]\n' Got '[ 0042]\n[0042]\n[ 42]\n\n[ -0042]\n[-0042]\n[ -42]\n'

stdout:
[  0042]
[0042]
[    42]

[ -0042]
[-0042]
[   -42]
stderr:
sush12 printf %6.4d -- "precision" does padding for integers

[sush stdout] Expected '[ 0042]\n[0042]\n[ 42]\n--\n[ -0042]\n[-0042]\n[ -42]\n' Got '[42]\n[42]\n[42]\n--\n[-42]\n[-42]\n[-42]\n'

stdout:
[42]
[42]
[42]
--
[-42]
[-42]
[-42]
stderr:
toysh13 printf %6.4x X o

[toysh stdout] Expected '[ 002a]\n[002a]\n[ 2a]\n--\n[ 002A]\n[002A]\n[ 2A]\n--\n[ 0052]\n[0052]\n[ 52]\n' Got '[ 002a]\n[002a]\n[ 2a]\n\n[ 002A]\n[002A]\n[ 2A]\n\n[ 0052]\n[0052]\n[ 52]\n'

stdout:
[  002a]
[002a]
[    2a]

[  002A]
[002A]
[    2A]

[  0052]
[0052]
[    52]
stderr:
sush13 printf %6.4x X o

[sush stdout] Expected '[ 002a]\n[002a]\n[ 2a]\n--\n[ 002A]\n[002A]\n[ 2A]\n--\n[ 0052]\n[0052]\n[ 52]\n' Got '[2a]\n[2a]\n[2a]\n--\n[2A]\n[2A]\n[2A]\n--\n[52]\n[52]\n[52]\n'

stdout:
[2a]
[2a]
[2a]
--
[2A]
[2A]
[2A]
--
[52]
[52]
[52]
stderr:
toysh14 %06d zero padding vs. %6.6d

[toysh stdout] Expected '[000042]\n[-00042]\n--\n[000042]\n[-000042]\n' Got '[000042]\n[-00042]\n\n[000042]\n[-000042]\n'

stdout:
[000042]
[-00042]

[000042]
[-000042]
stderr:
sush14 %06d zero padding vs. %6.6d

[sush stdout] Expected '[000042]\n[-00042]\n--\n[000042]\n[-000042]\n' Got '[000042]\n[-00042]\n--\n[42]\n[-42]\n'

stdout:
[000042]
[-00042]
--
[42]
[-42]
stderr:
mksh16 %06s is no-op

stdout:
(    42)
(   -42)
((status=1
stderr:
printf: %06s: invalid conversion specification
printf: %06s: invalid conversion specification
ksh16 %06s is no-op

[ksh stdout] Expected '( 42)\n( -42)\n( 42)\n( -42)\nstatus=0\n' Got '( 42)\n( -42)\n((status=1\n'

stdout:
(    42)
(   -42)
((status=1
stderr:
printf: %06s: invalid conversion specification
printf: %06s: invalid conversion specification
brush16 %06s is no-op

[brush stdout] Expected '( 42)\n( -42)\n( 42)\n( -42)\nstatus=0\n' Got '( 42)\n( -42)\nstatus=1\n'

stdout:
(    42)
(   -42)
status=1
stderr:
ERROR printf: printf parsing error: %06s: invalid conversion specification
ERROR printf: printf parsing error: %06s: invalid conversion specification
sush17 printf %6.4s does both truncation and padding

[sush stdout] Expected '[ foo]\n[ foo]\n[foo ]\n[spam-eggs]\n[ spam]\n[spam ]\n' Got '[ foo]\n[foo]\n[foo]\n[spam-eggs]\n[spam-eggs]\n[spam-eggs]\n'

stdout:
[   foo]
[foo]
[foo]
[spam-eggs]
[spam-eggs]
[spam-eggs]
stderr:
mksh18 printf %6.0s and %0.0s

stdout:
[      ]
[
stderr:
printf: %0.0s: invalid conversion specification
ksh18 printf %6.0s and %0.0s

[ksh stdout] Expected '[ ]\n[]\n', got '[ ]\n['
[ksh status] Expected 0, got 1

stdout:
[      ]
[
stderr:
printf: %0.0s: invalid conversion specification
sush18 printf %6.0s and %0.0s

[sush stdout] Expected '[ ]\n[]\n', got '[foo]\n[foo]\n'

stdout:
[foo]
[foo]
stderr:
brush18 printf %6.0s and %0.0s

[brush stdout] Expected '[ ]\n[]\n', got '[ ]\n'
[brush status] Expected 0, got 1

stdout:
[      ]
stderr:
ERROR printf: printf parsing error: %0.0s: invalid conversion specification
zsh19 printf %6.s and %0.s

stdout:
[   foo]
[foo]
stderr:
mksh19 printf %6.s and %0.s

stdout:
[      ]
[
stderr:
printf: %0.s: invalid conversion specification
ksh19 printf %6.s and %0.s

[ksh stdout] Expected '[ ]\n[]\n', got '[ ]\n['
[ksh status] Expected 0, got 1

stdout:
[      ]
[
stderr:
printf: %0.s: invalid conversion specification
sush19 printf %6.s and %0.s

[sush stdout] Expected '[ ]\n[]\n', got '[foo]\n[foo]\n'

stdout:
[foo]
[foo]
stderr:
brush19 printf %6.s and %0.s

[brush stdout] Expected '[ ]\n[]\n', got '[ ]\n'
[brush status] Expected 0, got 1

stdout:
[      ]
stderr:
ERROR printf: printf parsing error: %0.s: invalid conversion specification
sush20 printf %*.*s (width/precision from args)

[sush stdout] Expected '[ hello]\n[hel]\n[ hel]\n[ hel]\n[ hel]\n' Got ''
[sush status] Expected 0, got 1

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: printf: Other("Error parsing the format string %* 9")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Error parsing the format string %.* 3")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: printf: Other("Error parsing the format string %* 9")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: printf: Other("Error parsing the format string %9.* 3")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: printf: Other("Error parsing the format string %* 9")
sush21 unsigned / octal / hex

[sush stdout] Expected '[42]\n[52]\n[2a]\n[2A]\n\n[61]\n[61]\n', got '[42]\n[52]\n[2a]\n[2A]\n\n'
[sush status] Expected 0, got 1

stdout:
[42]
[52]
[2a]
[2A]

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 7: printf: ArithError("", InvalidNumber("'a"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 8: printf: ArithError("", InvalidNumber("'ab"))
mksh22 unsigned / octal / hex big

stdout:
[1]
[1]
[1]
[1]

[2147483647]
[17777777777]
[7fffffff]
[7FFFFFFF]

stderr:
ksh22 unsigned / octal / hex big

[ksh stdout] Expected '[4294967296]\n[40000000000]\n[100000000]\n[100000000]\n\n[9223372036854775807]\n[777777777777777777777]\n[7fffffffffffffff]\n[7FFFFFFFFFFFFFFF]\n\n' Got '[1]\n[1]\n[1]\n[1]\n\n[2147483647]\n[17777777777]\n[7fffffff]\n[7FFFFFFF]\n\n'

stdout:
[1]
[1]
[1]
[1]

[2147483647]
[17777777777]
[7fffffff]
[7FFFFFFF]

stderr:
ash23 empty string (osh is more strict)

stdout:
0
stderr:
ash: invalid number ''
sush23 empty string (osh is more strict)

[sush stdout] Expected '0\n', got '\n'

stdout:
stderr: 
osh23 empty string (osh is more strict)

stdout:
stderr: 
  printf '%d\n' ''
                ^
[ stdin ]:1: printf expected an integer, got ''
mksh24 No char after ' => zero code point

stdout:
0
0
stderr:
printf: ‘'’: expected a numeric value
printf: ‘"’: expected a numeric value
ksh24 No char after ' => zero code point

[ksh status] Expected 0, got 1

stdout:
0
0
stderr:
printf: ‘'’: expected a numeric value
printf: ‘"’: expected a numeric value
sush24 No char after ' => zero code point

[sush stdout] Expected '0\n0\n', got '\'\n"\n'

stdout:
'
"
stderr:
dash25 Unicode char with '

stdout:
ce
206
316

e4
228
344

stderr:
ash25 Unicode char with '

stdout:
ce
206
316

e4
228
344

stderr:
mksh25 Unicode char with '

stdout:
weird bug
stderr:
toysh25 Unicode char with '

[toysh stdout] Expected '3bc\n956\n1674\n\n4e09\n19977\n47011\n\n', got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush25 Unicode char with '

[sush stdout] Expected '3bc\n956\n1674\n\n4e09\n19977\n47011\n\n', got "'\xce\xbc\n\n'\xe4\xb8\x89\n\n"

stdout:
'μ

'三

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: printf: ArithError("", InvalidNumber("'μ"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: printf: ArithError("", InvalidNumber("'μ"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 11: printf: ArithError("", InvalidNumber("'三"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 13: printf: ArithError("", InvalidNumber("'三"))
sush26 Invalid UTF-8

[sush stdout] Expected 'bytes1\nce\n206\n316\n\nbytes2\nbc\n188\n274\n\noverlong2\nc1\n193\n301\n\noverlong3\ne0\n224\n340\n\n' Got "bytes1\n'\n\nbytes2\n'\n\noverlong2\n'\n\noverlong3\n'\n\n"

stdout:
bytes1
'

bytes2
'

overlong2
'

overlong3
'

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 11: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 13: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 19: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 21: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 26: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 28: printf: ArithError("", InvalidNumber("'"))
brush26 Invalid UTF-8

[brush stdout] Expected 'bytes1\nce\n206\n316\n\nbytes2\nbc\n188\n274\n\noverlong2\nc1\n193\n301\n\noverlong3\ne0\n224\n340\n\n' Got 'bytes1\n0\n0\n0\n\nbytes2\n0\n0\n0\n\noverlong2\n0\n0\n0\n\noverlong3\n0\n0\n0\n\n'

stdout:
bytes1
0
0
0

bytes2
0
0
0

overlong2
0
0
0

overlong3
0
0
0

stderr:
ERROR error: i/o error: stream did not contain valid UTF-8
ERROR error: i/o error: stream did not contain valid UTF-8
ERROR error: i/o error: stream did not contain valid UTF-8
ERROR error: i/o error: stream did not contain valid UTF-8
dash27 Too large

stdout:
too large
f4
244
364

stderr:
ash27 Too large

stdout:
too large
f4
244
364

stderr:
mksh27 Too large

stdout:
weird bug
stderr:
toysh27 Too large

[toysh stdout] Expected 'too large\n111111\n1118481\n4210421\n\n', got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush27 Too large

[sush stdout] Expected 'too large\n111111\n1118481\n4210421\n\n', got "too large\n'\n\n"

stdout:
too large
'

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: printf: ArithError("", InvalidNumber("'"))
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 7: printf: ArithError("", InvalidNumber("'"))
brush27 Too large

[brush stdout] Expected 'too large\n111111\n1118481\n4210421\n\n', got 'too large\n0\n0\n0\n\n'

stdout:
too large
0
0
0

stderr:
ERROR error: i/o error: stream did not contain valid UTF-8
osh27 Too large

stdout:
too large
f4
244
364

stderr:
  printf '%x\n' \'$too_large
                ^~
[ stdin ]:5: Warning: UTF-8 decode: Integer too large at offset 1 in string of 5 bytes
  printf '%u\n' \'$too_large
                ^~
[ stdin ]:6: Warning: UTF-8 decode: Integer too large at offset 1 in string of 5 bytes
  printf '%o\n' \'$too_large
                ^~
[ stdin ]:7: Warning: UTF-8 decode: Integer too large at offset 1 in string of 5 bytes
osh28 negative numbers with unsigned / octal / hex

stdout:
status=1
status=1
status=1
status=1
stderr:
  [%u]\n
    ^
[ printf arg at line 1 of [ stdin ] ]:1

  printf '[%u]\n' -42
         ^
[ stdin ]:1: Can't format negative number with %u: -42
  [%o]\n
    ^
[ printf arg at line 4 of [ stdin ] ]:1

  printf '[%o]\n' -42
         ^
[ stdin ]:4: Can't format negative number with %o: -42
  [%x]\n
    ^
[ printf arg at line 7 of [ stdin ] ]:1

  printf '[%x]\n' -42
         ^
[ stdin ]:7: Can't format negative number with %x: -42
  [%X]\n
    ^
[ printf arg at line 10 of [ stdin ] ]:1

  printf '[%X]\n' -42
         ^
[ stdin ]:10: Can't format negative number with %X: -42
sush29 printf floating point (not required, but they all implement it)

[sush stdout] Expected '[3.141590]\n[3.14]\n[ 3.14]\n[3.14 ]\n[3.141590]\n[3.140000]\n' Got '[3.141590]\n[3.141590]\n[3.141590]\n[3.141590]\n[3.141590]\n[3.140000]\n'

stdout:
[3.141590]
[3.141590]
[3.141590]
[3.141590]
[3.141590]
[3.140000]
stderr:
osh29 printf floating point (not required, but they all implement it)

stdout:
stderr: 
  [%f]\n
    ^
[ printf arg at line 1 of [ stdin ] ]:1

  printf '[%f]\n' 3.14159
         ^
[ stdin ]:1: osh printf doesn't support floating point
  [%.2f]\n
      ^
[ printf arg at line 2 of [ stdin ] ]:1

  printf '[%.2f]\n' 3.14159
         ^
[ stdin ]:2: osh printf doesn't support floating point
  [%8.2f]\n
       ^
[ printf arg at line 3 of [ stdin ] ]:1

  printf '[%8.2f]\n' 3.14159
         ^
[ stdin ]:3: osh printf doesn't support floating point
  [%-8.2f]\n
        ^
[ printf arg at line 4 of [ stdin ] ]:1

  printf '[%-8.2f]\n' 3.14159
         ^
[ stdin ]:4: osh printf doesn't support floating point
  [%-f]\n
     ^
[ printf arg at line 5 of [ stdin ] ]:1

  printf '[%-f]\n' 3.14159
         ^
[ stdin ]:5: osh printf doesn't support floating point
  [%-f]\n
     ^
[ printf arg at line 6 of [ stdin ] ]:1

  printf '[%-f]\n' 3.14
         ^
[ stdin ]:6: osh printf doesn't support floating point
sush30 printf floating point with - and 0

[sush stdout] Expected '[ 3.1400]\n[003.1400]\n[ 3.1400]\n[003.1400]\n---\n[3.1400 ]\n[3.1400 ]\n[3.1400 ]\n[3.1400 ]\n' Got '[3.140000]\n[3.140000]\n[3.140000]\n[3.140000]\n---\n[3.140000]\n[3.140000]\n[3.140000]\n[3.140000]\n'

stdout:
[3.140000]
[3.140000]
[3.140000]
[3.140000]
---
[3.140000]
[3.140000]
[3.140000]
[3.140000]
stderr:
osh30 printf floating point with - and 0

stdout:
---
stderr:
  [%8.4f]\n
       ^
[ printf arg at line 1 of [ stdin ] ]:1

  printf '[%8.4f]\n' 3.14
         ^
[ stdin ]:1: osh printf doesn't support floating point
  [%08.4f]\n
        ^
[ printf arg at line 2 of [ stdin ] ]:1

  printf '[%08.4f]\n' 3.14
         ^
[ stdin ]:2: osh printf doesn't support floating point
  [%8.04f]\n
       ^
[ printf arg at line 3 of [ stdin ] ]:1

  printf '[%8.04f]\n' 3.14  # meaning less 0
         ^
[ stdin ]:3: Expected a printf format character
  [%08.04f]\n
        ^
[ printf arg at line 4 of [ stdin ] ]:1

  printf '[%08.04f]\n' 3.14
         ^
[ stdin ]:4: Expected a printf format character
  [%-8.4f]\n
        ^
[ printf arg at line 6 of [ stdin ] ]:1

  printf '[%-8.4f]\n' 3.14
         ^
[ stdin ]:6: osh printf doesn't support floating point
  [%-08.4f]\n
         ^
[ printf arg at line 7 of [ stdin ] ]:1

  printf '[%-08.4f]\n' 3.14
         ^
[ stdin ]:7: osh printf doesn't support floating point
  [%-8.04f]\n
        ^
[ printf arg at line 8 of [ stdin ] ]:1

  printf '[%-8.04f]\n' 3.14
         ^
[ stdin ]:8: Expected a printf format character
  [%-08.04f]\n
         ^
[ printf arg at line 9 of [ stdin ] ]:1

  printf '[%-08.04f]\n' 3.14
         ^
[ stdin ]:9: Expected a printf format character
sush31 printf eE fF gG

[sush stdout] Expected '[3.140000e+00]\n[3.140000E+00]\n[3.140000]\n[3.14]\n[3.14]\n' Got '[3.140000]\n'
[sush status] Expected 0, got 1

stdout:
[3.140000]
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: printf: Other("Incorrect type passed as an argument %e 3.14")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Incorrect type passed as an argument %E 3.14")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: printf: Other("Incorrect type passed as an argument %g 3.14")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: printf: Other("Incorrect type passed as an argument %G 3.14")
osh31 printf eE fF gG

stdout:
stderr: 
  [%e]\n
    ^
[ printf arg at line 1 of [ stdin ] ]:1

  printf '[%e]\n' 3.14
         ^
[ stdin ]:1: osh printf doesn't support floating point
  [%E]\n
    ^
[ printf arg at line 2 of [ stdin ] ]:1

  printf '[%E]\n' 3.14
         ^
[ stdin ]:2: osh printf doesn't support floating point
  [%f]\n
    ^
[ printf arg at line 3 of [ stdin ] ]:1

  printf '[%f]\n' 3.14
         ^
[ stdin ]:3: osh printf doesn't support floating point
  [%g]\n
    ^
[ printf arg at line 4 of [ stdin ] ]:1

  printf '[%g]\n' 3.14
         ^
[ stdin ]:4: osh printf doesn't support floating point
  [%G]\n
    ^
[ printf arg at line 5 of [ stdin ] ]:1

  printf '[%G]\n' 3.14
         ^
[ stdin ]:5: osh printf doesn't support floating point
dash32 printf backslash escapes

stdout:
['a\tb']
['\\xE2\\x98\\xA0']
['$e']
['\x1f7']
stderr:
sush32 printf backslash escapes

[sush stdout] Expected "['a\\tb']\n['\\xe2\\x98\\xa0']\n['$e']\n['\\x1f7']\n" Got "['a\\tb']\n['\\\\xE2\\\\x98\\\\xA0']\n['\\\\044e']\n['\\\\0377']\n"

stdout:
['a\tb']
['\\xE2\\x98\\xA0']
['\\044e']
['\\0377']
stderr:
sush33 printf octal backslash escapes

[sush stdout] Expected "['\\x1f7']\n['\\xff']\n", got "['\\\\0377']\n['\\\\377']\n"

stdout:
['\\0377']
['\\377']
stderr:
brush33 printf octal backslash escapes

[brush stdout] Expected "['\\x1f7']\n['\\xff']\n", got "['\\x1f7']\n"
[brush status] Expected 0, got 1

stdout:
['\x1f7']
stderr:
ERROR error: i/o error: stream did not contain valid UTF-8
dash34 printf unicode backslash escapes

stdout:
['\\u2620']
['\\U0000065f']
stderr:
ash34 printf unicode backslash escapes

stdout:
['\\u2620']
['\\U0000065f']
stderr:
toysh34 printf unicode backslash escapes

[toysh stdout] Expected "['\\xe2\\x98\\xa0']\n['\\xd9\\x9f']\n", got "['\\\\u2620']\n['\\\\U0000065f']\n"

stdout:
['\\u2620']
['\\U0000065f']
stderr:
sush34 printf unicode backslash escapes

[sush stdout] Expected "['\\xe2\\x98\\xa0']\n['\\xd9\\x9f']\n", got "['\\\\u2620']\n['\\\\U0000065f']\n"

stdout:
['\\u2620']
['\\U0000065f']
stderr:
sush36 printf % escapes

[sush stdout] Expected '[%]\n', got ''
[sush status] Expected 0, got 1

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: printf: Other("Too many arguments passed %% ")
sush37 printf %b backslash escaping

[sush stdout] Expected '[\\044]\n[$]\nstatus=0\n', got '[\\044]\n[\\044]\nstatus=0\n'

stdout:
[\044]
[\044]
status=0
stderr:
sush38 printf %b with \c early return

[sush stdout] Expected '[ab\ncd0\n', got '[ab\ncd\\cxy]\n0\n'

stdout:
[ab
cd\cxy]
0
stderr:
brush38 printf %b with \c early return

[brush stdout] Expected '[ab\ncd0\n', got '[ab\ncd]\n0\n'

stdout:
[ab
cd]
0
stderr:
dash39 printf %c -- doesn't respect UTF-8! Bad.

stdout:
[$\u03bc\u03bc]
1
stderr:
ash39 printf %c -- doesn't respect UTF-8! Bad.

stdout:
[\u03bc\u03bc]
1
stderr:
sush39 printf %c -- doesn't respect UTF-8! Bad.

[sush stdout] Expected '[\xce\xbc\xce\xbc]\n1\n', got '[\xce\xbc\xce\xbc]\n0\n'

stdout:
[μμ]
0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: printf: Other("Incorrect type passed as an argument %c μμ")
osh39 printf %c -- doesn't respect UTF-8! Bad.

stdout:
[μμ]
0
stderr:
  %c
   ^
[ printf arg at line 3 of [ stdin ] ]:1

  printf '%c' "$twomu" | wc --bytes
         ^
[ stdin ]:3: osh printf doesn't support single characters (bytes)
dash40 printf invalid format

stdout:
status=2
status=2
stderr:
dash: 1: printf: %z: invalid directive
dash: 3: printf: %-z: invalid directive
osh40 printf invalid format

stdout:
status=2
status=2
stderr:
  %z
   ^
[ printf arg at line 1 of [ stdin ] ]:1

  printf '%z' 42
         ^
[ stdin ]:1: Invalid printf format character
  %-z
    ^
[ printf arg at line 3 of [ stdin ] ]:1

  printf '%-z' 42
         ^
[ stdin ]:3: Invalid printf format character
bash41 printf %q

stdout:
[a\ b]
stderr:
dash41 printf %q

stdout:
[
stderr:
dash: 2: printf: %q: invalid directive
ash41 printf %q

stdout:
[
stderr:
ash: %q]\n: invalid format
zsh41 printf %q

stdout:
[a\ b]
stderr:
toysh41 printf %q

[toysh stdout] Expected "['a b']\n", got '['
[toysh status] Expected 0, got 1

stdout:
[
stderr:
printf: bad %q@3
sush41 printf %q

[sush stdout] Expected "['a b']\n", got '[a b]\n'

stdout:
[a b]
stderr:
bash42 printf %6q (width)

stdout:
[  a\ b]
[a\ b]
stderr:
dash42 printf %6q (width)

stdout:
[[
stderr:
dash: 2: printf: %6q: invalid directive
dash: 3: printf: %1q: invalid directive
ash42 printf %6q (width)

stdout:
[[
stderr:
ash: %6q]\n: invalid format
ash: %1q]\n: invalid format
zsh42 printf %6q (width)

stdout:
[  a\ b]
[a\ b]
stderr:
mksh42 printf %6q (width)

stdout:
[[
stderr:
printf: %6q: invalid conversion specification
printf: %1q: invalid conversion specification
ksh42 printf %6q (width)

[ksh stdout] Expected "[ 'a b']\n['a b']\n", got '[['
[ksh status] Expected 0, got 1

stdout:
[[
stderr:
printf: %6q: invalid conversion specification
printf: %1q: invalid conversion specification
toysh42 printf %6q (width)

[toysh stdout] Expected "[ 'a b']\n['a b']\n", got '[['
[toysh status] Expected 0, got 1

stdout:
[[
stderr:
printf: bad %q@4
printf: bad %q@4
sush42 printf %6q (width)

[sush stdout] Expected "[ 'a b']\n['a b']\n", got '[a b]\n[a b]\n'

stdout:
[a b]
[a b]
stderr:
brush42 printf %6q (width)

[brush stdout] Expected "[ 'a b']\n['a b']\n", got ''
[brush status] Expected 0, got 1

stdout:
stderr: 
ERROR printf: printf parsing error: %6q: invalid conversion specification
ERROR printf: printf parsing error: %1q: invalid conversion specification
ash43 printf negative numbers

stdout:
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[0] status=1
[0] status=1
[0] status=1
[0] status=1
stderr:
ash: invalid number '-42 '
ash: invalid number '-42 '
ash: invalid number '-42z'
ash: invalid number '-42z'
zsh43 printf negative numbers

stdout:
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[0] status=1
[0] status=1
stderr:
zsh: bad math expression: operator expected at `z'
zsh: bad math expression: operator expected at `z'
sush43 printf negative numbers

[sush stdout] Expected '[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=1\n[-42] status=1\n[-42] status=1\n[-42] status=1\n' Got '[-42] status=0\n[-42] status=0\n[ -42] status=0\n[ -42] status=0\n[ -42 ] status=0\n[ -42 ] status=0\n[ -42z] status=0\n[ -42z] status=0\n'

stdout:
[-42] status=0
[-42] status=0
[ -42] status=0
[ -42] status=0
[ -42 ] status=0
[ -42 ] status=0
[ -42z] status=0
[ -42z] status=0
stderr:
brush43 printf negative numbers

[brush stdout] Expected '[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=1\n[-42] status=1\n[-42] status=1\n[-42] status=1\n' Got '[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=0\n[-42] status=0\n'

stdout:
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '\ -42\ ': value not completely converted
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '\ -42\ ': value not completely converted
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '\ -42z': value not completely converted
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '\ -42z': value not completely converted
osh43 printf negative numbers

stdout:
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
[-42] status=0
status=1
status=1
stderr:
  printf '[%d] ' ' -42z'
                 ^
[ stdin ]:16: printf expected an integer, got ' -42z'
  printf '[%i] ' ' -42z'
                 ^
[ stdin ]:18: printf expected an integer, got ' -42z'
sush44 printf + and space flags

[sush stdout] Expected '[+42]\n[-42]\n[ 42]\n[-42]\n', got ''
[sush status] Expected 0, got 1

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: printf: Other("Error parsing the format string %+ 42")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Error parsing the format string %+ -42")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: printf: Other("Error parsing the format string %  42")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: printf: Other("Error parsing the format string %  -42")
osh44 printf + and space flags

stdout:
stderr: 
  [%+d]\n
    ^
[ printf arg at line 1 of [ stdin ] ]:1

  printf '[%+d]\n' 42
         ^
[ stdin ]:1: osh printf doesn't support the '+' flag
  [%+d]\n
    ^
[ printf arg at line 2 of [ stdin ] ]:1

  printf '[%+d]\n' -42
         ^
[ stdin ]:2: osh printf doesn't support the '+' flag
  [% d]\n
    ^
[ printf arg at line 3 of [ stdin ] ]:1

  printf '[% d]\n' 42
         ^
[ stdin ]:3: osh printf doesn't support the ' ' flag
  [% d]\n
    ^
[ printf arg at line 4 of [ stdin ] ]:1

  printf '[% d]\n' -42
         ^
[ stdin ]:4: osh printf doesn't support the ' ' flag
sush45 printf # flag

[sush stdout] Expected '[0][052]\n[0][0x2a]\n[0][0X2A]\n---\n[3][3.]\n[3][3.00000]\n' Got '---\n'
[sush status] Expected 0, got 1

stdout:
---
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: printf: Other("Error parsing the format string %# 0")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Error parsing the format string %# 0")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: printf: Other("Error parsing the format string %# 0")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: printf: Other("Error parsing the format string %# 3")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: printf: Other("Incorrect type passed as an argument %g 3")
osh45 printf # flag

stdout:
---
stderr:
  [%#o][%#o]\n
    ^
[ printf arg at line 1 of [ stdin ] ]:1

  printf '[%#o][%#o]\n' 0 42
         ^
[ stdin ]:1: osh printf doesn't support the '#' flag
  [%#x][%#x]\n
    ^
[ printf arg at line 2 of [ stdin ] ]:1

  printf '[%#x][%#x]\n' 0 42
         ^
[ stdin ]:2: osh printf doesn't support the '#' flag
  [%#X][%#X]\n
    ^
[ printf arg at line 3 of [ stdin ] ]:1

  printf '[%#X][%#X]\n' 0 42
         ^
[ stdin ]:3: osh printf doesn't support the '#' flag
  [%.0f][%#.0f]\n
      ^
[ printf arg at line 5 of [ stdin ] ]:1

  printf '[%.0f][%#.0f]\n' 3 3
         ^
[ stdin ]:5: osh printf doesn't support floating point
  [%g][%#g]\n
    ^
[ printf arg at line 6 of [ stdin ] ]:1

  printf '[%g][%#g]\n' 3 3
         ^
[ stdin ]:6: osh printf doesn't support floating point
ash46 Runtime error for invalid integer

stdout:
0
status=1
0
status=1
stderr:
ash: invalid number '3abc'
ash: invalid number 'xyz'
zsh46 Runtime error for invalid integer

stdout:
0
status=1
0
status=0
stderr:
zsh: bad math expression: operator expected at `abc'
sush46 Runtime error for invalid integer

[sush stdout] Expected '3\nstatus=1\n0\nstatus=1\n', got '3abc\nstatus=0\nxyz\nstatus=0\n'

stdout:
3abc
status=0
xyz
status=0
stderr:
brush46 Runtime error for invalid integer

[brush stdout] Expected '3\nstatus=1\n0\nstatus=1\n', got '3\nstatus=0\n0\nstatus=0\n'

stdout:
3
status=0
0
status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '3abc': value not completely converted
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: 'xyz': expected a numeric value
osh46 Runtime error for invalid integer

stdout:
status=1
status=1
stderr:
  printf '%d\n' $x
                ^~
[ stdin ]:2: printf expected an integer, got '3abc'
  printf '%d\n' xyz
                ^~~
[ stdin ]:4: printf expected an integer, got 'xyz'
dash47 %(strftime format)T

stdout:
status=2
stderr:
dash: 2: printf: %(: invalid directive
dash: 4: printf: %(: invalid directive
ash47 %(strftime format)T

stdout:
status=1
stderr:
ash: %(%Y-%m-%d)T\n: invalid format
ash: %(%Y-%m-%d)T\n: invalid format
zsh47 %(strftime format)T

stdout:
status=1
stderr:
printf: %(: invalid directive
printf: %(: invalid directive
mksh47 %(strftime format)T

stdout:
status=1
stderr:
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
ksh47 %(strftime format)T

[ksh stdout] Expected '2019-05-16\n2019-05-15\nstatus=0\n', got 'status=1\n'

stdout:
status=1
stderr:
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
toysh47 %(strftime format)T

[toysh stdout] Expected '2019-05-16\n2019-05-15\nstatus=0\n', got 'status=1\n'

stdout:
status=1
stderr:
printf: bad %(@2
printf: bad %(@2
sush47 %(strftime format)T

[sush stdout] Expected '2019-05-16\n2019-05-15\nstatus=0\n', got 'status=1\n'

stdout:
status=1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Error parsing the format string %( 1557978599")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: printf: Other("Error parsing the format string %( 1557978599")
brush47 %(strftime format)T

[brush stdout] Expected '2019-05-16\n2019-05-15\nstatus=0\n', got 'status=1\n'

stdout:
status=1
stderr:
ERROR printf: printf parsing error: %(: invalid conversion specification
ERROR printf: printf parsing error: %(: invalid conversion specification
dash48 %(strftime format)T doesn't respect TZ if not exported

stdout:
stderr: 
dash: 2: printf: %(: invalid directive
dash: 5: printf: %(: invalid directive
ash48 %(strftime format)T doesn't respect TZ if not exported

stdout:
stderr: 
ash: %(%Y-%m-%d %H:%M:%S)T\n: invalid format
ash: %(%Y-%m-%d %H:%M:%S)T\n: invalid format
zsh48 %(strftime format)T doesn't respect TZ if not exported

stdout:
stderr: 
printf: %(: invalid directive
printf: %(: invalid directive
mksh48 %(strftime format)T doesn't respect TZ if not exported

stdout:
stderr: 
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
ksh48 %(strftime format)T doesn't respect TZ if not exported

[ksh stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
toysh48 %(strftime format)T doesn't respect TZ if not exported

[toysh stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
printf: bad %(@2
printf: bad %(@2
sush48 %(strftime format)T doesn't respect TZ if not exported

[sush stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Error parsing the format string %( 1557978599")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: printf: Other("Error parsing the format string %( 1557978599")
brush48 %(strftime format)T doesn't respect TZ if not exported

[brush stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
ERROR printf: printf parsing error: %(: invalid conversion specification
ERROR printf: printf parsing error: %(: invalid conversion specification
dash49 %(strftime format)T TZ in environ but not in shell's memory

stdout:
stderr: 
dash: 2: printf: %(: invalid directive
dash: 6: printf: %(: invalid directive
ash49 %(strftime format)T TZ in environ but not in shell's memory

stdout:
stderr: 
ash: %(%Y-%m-%d %H:%M:%S)T\n: invalid format
ash: %(%Y-%m-%d %H:%M:%S)T\n: invalid format
zsh49 %(strftime format)T TZ in environ but not in shell's memory

stdout:
stderr: 
printf: %(: invalid directive
printf: %(: invalid directive
mksh49 %(strftime format)T TZ in environ but not in shell's memory

stdout:
stderr: 
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
ksh49 %(strftime format)T TZ in environ but not in shell's memory

[ksh stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
toysh49 %(strftime format)T TZ in environ but not in shell's memory

[toysh stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
printf: bad %(@2
printf: bad %(@2
sush49 %(strftime format)T TZ in environ but not in shell's memory

[sush stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Error parsing the format string %( 1557978599")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: printf: Other("Error parsing the format string %( 1557978599")
brush49 %(strftime format)T TZ in environ but not in shell's memory

[brush stdout] Expected 'not equal\n', got ''

stdout:
stderr: 
ERROR printf: printf parsing error: %(: invalid conversion specification
ERROR printf: printf parsing error: %(: invalid conversion specification
dash50 %10.5(strftime format)T

stdout:
[[status=2
stderr:
dash: 2: printf: %10.5(: invalid directive
dash: 4: printf: %10.5(: invalid directive
ash50 %10.5(strftime format)T

stdout:
[[status=1
stderr:
ash: %10.5(%Y-%m-%d)T]\n: invalid format
ash: %10.5(%Y-%m-%d)T]\n: invalid format
zsh50 %10.5(strftime format)T

stdout:
[[status=1
stderr:
printf: %10.5(: invalid directive
printf: %10.5(: invalid directive
mksh50 %10.5(strftime format)T

stdout:
[[status=1
stderr:
printf: %10.5(: invalid conversion specification
printf: %10.5(: invalid conversion specification
ksh50 %10.5(strftime format)T

[ksh stdout] Expected '[ 2019-]\n[ 2019-]\nstatus=0\n', got '[[status=1\n'

stdout:
[[status=1
stderr:
printf: %10.5(: invalid conversion specification
printf: %10.5(: invalid conversion specification
toysh50 %10.5(strftime format)T

[toysh stdout] Expected '[ 2019-]\n[ 2019-]\nstatus=0\n', got '[[status=1\n'

stdout:
[[status=1
stderr:
printf: bad %(@7
printf: bad %(@7
sush50 %10.5(strftime format)T

[sush stdout] Expected '[ 2019-]\n[ 2019-]\nstatus=0\n', got 'status=1\n'

stdout:
status=1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 2: printf: Other("Error parsing the format string %10.5( 1557978599")
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: printf: Other("Error parsing the format string %10.5( 1557978599")
brush50 %10.5(strftime format)T

[brush stdout] Expected '[ 2019-]\n[ 2019-]\nstatus=0\n', got 'status=1\n'

stdout:
status=1
stderr:
ERROR printf: printf parsing error: %10.5(: invalid conversion specification
ERROR printf: printf parsing error: %10.5(: invalid conversion specification
dash52 bash truncates long strftime string at 128

stdout:
stderr: 
ash52 bash truncates long strftime string at 128

stdout:
stderr: 
zsh52 bash truncates long strftime string at 128

stdout:
stderr: 
mksh52 bash truncates long strftime string at 128

stdout:
stderr: 
ksh52 bash truncates long strftime string at 128

[ksh stdout] Expected '4\n40\n120\n124\n0\n', got '0\n0\n0\n0\n0\n'

stdout:
0
0
0
0
0
stderr:
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
printf: %(: invalid conversion specification
toysh52 bash truncates long strftime string at 128

[toysh stdout] Expected '4\n40\n120\n124\n0\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush52 bash truncates long strftime string at 128

[sush stdout] Expected '4\n40\n120\n124\n0\n', got '%()T0\n0\n0\n0\n0\n'

stdout:
%()T0
0
0
0
0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: Unexpected token: ()
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: local: can only be used in a function
seq: missing operand
Try 'seq --help' for more information.
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 13: Unexpected token: }

/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 14: strftime-format: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 14: printf: usage: printf [-v var] format [arguments]
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 15: strftime-format: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 15: printf: usage: printf [-v var] format [arguments]
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 16: strftime-format: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 16: printf: usage: printf [-v var] format [arguments]
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 17: strftime-format: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 17: printf: usage: printf [-v var] format [arguments]
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 18: strftime-format: command not found
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 18: printf: usage: printf [-v var] format [arguments]
brush52 bash truncates long strftime string at 128

[brush stdout] Expected '4\n40\n120\n124\n0\n', got '0\n0\n0\n0\n0\n'

stdout:
0
0
0
0
0
stderr:
ERROR printf: printf parsing error: %(: invalid conversion specification
ERROR printf: printf parsing error: %(: invalid conversion specification
ERROR printf: printf parsing error: %(: invalid conversion specification
ERROR printf: printf parsing error: %(: invalid conversion specification
ERROR printf: printf parsing error: %(: invalid conversion specification
osh52 bash truncates long strftime string at 128

stdout:
4
40
120
124
128
stderr:
dash53 printf with explicit NUL byte

stdout:
stderr: 
ash53 printf with explicit NUL byte

stdout:
stderr: 
zsh53 printf with explicit NUL byte

stdout:
xzz
stderr:
toysh53 printf with explicit NUL byte

[toysh stdout] Expected u'x', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush53 printf with explicit NUL byte

[sush stdout] Expected u'x', got 'x\x00z\x00z'

stdout:
xzz
stderr:
brush53 printf with explicit NUL byte

[brush stdout] Expected u'x', got 'x\x00z\x00z'

stdout:
xzz
stderr:
bash54 printf positive integer overflow

stdout:
18446744073709551615
status=0
18446744073709551615
status=0

9223372036854775807
status=0
9223372036854775807
status=0

stderr:
bash: line 4: printf: warning: 18446744073709551616: Numerical result out of range
bash: line 2: printf: warning: 18446744073709551615: Numerical result out of range
bash: line 4: printf: warning: 18446744073709551616: Numerical result out of range
dash54 printf positive integer overflow

stdout:
18446744073709551615
status=0
18446744073709551615
status=1

9223372036854775807
status=1
9223372036854775807
status=1

stderr:
dash: 4: printf: 18446744073709551616: Numerical result out of range
dash: 2: printf: 18446744073709551615: Numerical result out of range
dash: 4: printf: 18446744073709551616: Numerical result out of range
ash54 printf positive integer overflow

stdout:
18446744073709551615
status=0
0
status=1

0
status=1
0
status=1

stderr:
ash: invalid number '18446744073709551616'
ash: invalid number '18446744073709551615'
ash: invalid number '18446744073709551616'
zsh54 printf positive integer overflow

stdout:
1844674407370955161
status=0
1844674407370955161
status=0

1844674407370955161
status=0
1844674407370955161
status=0

stderr:
zsh: number truncated after 19 digits: 18446744073709551615
zsh: number truncated after 19 digits: 18446744073709551616
zsh: number truncated after 19 digits: 18446744073709551615
zsh: number truncated after 19 digits: 18446744073709551616
mksh54 printf positive integer overflow

stdout:
18446744073709551615
status=0
18446744073709551615
status=1

9223372036854775807
status=1
9223372036854775807
status=1

stderr:
printf: ‘18446744073709551616’: Numerical result out of range
printf: ‘18446744073709551615’: Numerical result out of range
printf: ‘18446744073709551616’: Numerical result out of range
ksh54 printf positive integer overflow

[ksh stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '18446744073709551615\nstatus=0\n18446744073709551615\nstatus=1\n\n9223372036854775807\nstatus=1\n9223372036854775807\nstatus=1\n\n'

stdout:
18446744073709551615
status=0
18446744073709551615
status=1

9223372036854775807
status=1
9223372036854775807
status=1

stderr:
printf: ‘18446744073709551616’: Numerical result out of range
printf: ‘18446744073709551615’: Numerical result out of range
printf: ‘18446744073709551616’: Numerical result out of range
toysh54 printf positive integer overflow

[toysh stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '9223372036854775807\nstatus=1\n9223372036854775807\nstatus=1\n\n9223372036854775807\nstatus=1\n9223372036854775807\nstatus=1\n\n'

stdout:
9223372036854775807
status=1
9223372036854775807
status=1

9223372036854775807
status=1
9223372036854775807
status=1

stderr:
printf: bad %u 18446744073709551615: Numerical result out of range
printf: bad %u 18446744073709551616: Numerical result out of range
printf: bad %d 18446744073709551615: Numerical result out of range
printf: bad %d 18446744073709551616: Numerical result out of range
sush54 printf positive integer overflow

[sush stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '18446744073709551615\nstatus=0\n18446744073709551616\nstatus=0\n\n18446744073709551615\nstatus=0\n18446744073709551616\nstatus=0\n\n'

stdout:
18446744073709551615
status=0
18446744073709551616
status=0

18446744073709551615
status=0
18446744073709551616
status=0

stderr:
brush54 printf positive integer overflow

[brush stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '18446744073709551615\nstatus=0\n18446744073709551615\nstatus=0\n\n9223372036854775807\nstatus=0\n9223372036854775807\nstatus=0\n\n'

stdout:
18446744073709551615
status=0
18446744073709551615
status=0

9223372036854775807
status=0
9223372036854775807
status=0

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '18446744073709551616': Numerical result out of range
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '18446744073709551615': Numerical result out of range
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '18446744073709551616': Numerical result out of range
bash55 printf negative integer overflow

stdout:
1
status=0
18446744073709551615
status=0

-9223372036854775808
status=0
-9223372036854775808
status=0

stderr:
bash: line 5: printf: warning: -18446744073709551616: Numerical result out of range
bash: line 3: printf: warning: -18446744073709551615: Numerical result out of range
bash: line 5: printf: warning: -18446744073709551616: Numerical result out of range
dash55 printf negative integer overflow

stdout:
1
status=0
18446744073709551615
status=1

-9223372036854775808
status=1
-9223372036854775808
status=1

stderr:
dash: 5: printf: -18446744073709551616: Numerical result out of range
dash: 3: printf: -18446744073709551615: Numerical result out of range
dash: 5: printf: -18446744073709551616: Numerical result out of range
ash55 printf negative integer overflow

stdout:
0
status=1
0
status=1

0
status=1
0
status=1

stderr:
ash: invalid number '-18446744073709551615'
ash: invalid number '-18446744073709551616'
ash: invalid number '-18446744073709551615'
ash: invalid number '-18446744073709551616'
zsh55 printf negative integer overflow

stdout:
16602069666338596455
status=0
16602069666338596455
status=0

-1844674407370955161
status=0
-1844674407370955161
status=0

stderr:
zsh: number truncated after 19 digits: 18446744073709551615
zsh: number truncated after 19 digits: 18446744073709551616
zsh: number truncated after 19 digits: 18446744073709551615
zsh: number truncated after 19 digits: 18446744073709551616
mksh55 printf negative integer overflow

stdout:
1
status=0
18446744073709551615
status=1

-9223372036854775808
status=1
-9223372036854775808
status=1

stderr:
printf: ‘-18446744073709551616’: Numerical result out of range
printf: ‘-18446744073709551615’: Numerical result out of range
printf: ‘-18446744073709551616’: Numerical result out of range
ksh55 printf negative integer overflow

[ksh stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '1\nstatus=0\n18446744073709551615\nstatus=1\n\n-9223372036854775808\nstatus=1\n-9223372036854775808\nstatus=1\n\n'

stdout:
1
status=0
18446744073709551615
status=1

-9223372036854775808
status=1
-9223372036854775808
status=1

stderr:
printf: ‘-18446744073709551616’: Numerical result out of range
printf: ‘-18446744073709551615’: Numerical result out of range
printf: ‘-18446744073709551616’: Numerical result out of range
toysh55 printf negative integer overflow

[toysh stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '9223372036854775808\nstatus=1\n9223372036854775808\nstatus=1\n\n-9223372036854775808\nstatus=1\n-9223372036854775808\nstatus=1\n\n'

stdout:
9223372036854775808
status=1
9223372036854775808
status=1

-9223372036854775808
status=1
-9223372036854775808
status=1

stderr:
printf: bad %u -18446744073709551615: Numerical result out of range
printf: bad %u -18446744073709551616: Numerical result out of range
printf: bad %d -18446744073709551615: Numerical result out of range
printf: bad %d -18446744073709551616: Numerical result out of range
sush55 printf negative integer overflow

[sush stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '1\nstatus=0\nstatus=1\n\n-18446744073709551615\nstatus=0\n-18446744073709551616\nstatus=0\n\n'

stdout:
1
status=0
status=1

-18446744073709551615
status=0
-18446744073709551616
status=0

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: printf: ParseIntError("number too large to fit in target type")
brush55 printf negative integer overflow

[brush stdout] Expected 'status=1\nstatus=1\n\nstatus=1\nstatus=1\n\n', got '1\nstatus=0\n18446744073709551615\nstatus=0\n\n-9223372036854775808\nstatus=0\n-9223372036854775808\nstatus=0\n\n'

stdout:
1
status=0
18446744073709551615
status=0

-9223372036854775808
status=0
-9223372036854775808
status=0

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '-18446744073709551616': Numerical result out of range
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '-18446744073709551615': Numerical result out of range
/home/andy/git/oils-for-unix/oils/../../shells/brush/target/release/brush: '-18446744073709551616': Numerical result out of range