printf: Add test for width and precision in %b format

PR:		229641
Submitted by:	pfg
This commit is contained in:
jilles 2018-08-13 21:54:27 +00:00
parent 8dbb9baab8
commit 2f82a16a61
3 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ PACKAGE= tests
TAP_TESTS_SH= legacy_test TAP_TESTS_SH= legacy_test
${PACKAGE}FILES+= regress.b.out ${PACKAGE}FILES+= regress.b.out
${PACKAGE}FILES+= regress.bwidth.out
${PACKAGE}FILES+= regress.d.out ${PACKAGE}FILES+= regress.d.out
${PACKAGE}FILES+= regress.f.out ${PACKAGE}FILES+= regress.f.out
${PACKAGE}FILES+= regress.l1.out ${PACKAGE}FILES+= regress.l1.out

View File

@ -0,0 +1 @@
a

View File

@ -2,7 +2,7 @@
REGRESSION_START($1) REGRESSION_START($1)
echo '1..23' echo '1..24'
REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"')
REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123')
@ -27,5 +27,6 @@ REGRESSION_TEST(`missingpos1', `printf "%*.*1\$s" 1 1 1 2>&1')
REGRESSION_TEST(`missingpos1', `printf "%1\$*2\$.*s" 1 1 1 2>&1') REGRESSION_TEST(`missingpos1', `printf "%1\$*2\$.*s" 1 1 1 2>&1')
REGRESSION_TEST(`missingpos1', `printf "%*1\$.*2\$s" 1 1 1 2>&1') REGRESSION_TEST(`missingpos1', `printf "%*1\$.*2\$s" 1 1 1 2>&1')
REGRESSION_TEST(`missingpos1', `printf "%1\$*.*2\$s" 1 1 1 2>&1') REGRESSION_TEST(`missingpos1', `printf "%1\$*.*2\$s" 1 1 1 2>&1')
REGRESSION_TEST(`bwidth', `printf "%8.2b" "a\nb\n"')
REGRESSION_END() REGRESSION_END()